thrust::identity
Defined in thrust/functional.h
-
template<typename T = void>
struct identity identity
is a Unary Function that represents the identity function: it takes a single argumentx
, and returnsx
.The following code snippet demonstrates that
identity
returns its argument.#include <thrust/functional.h> #include <assert.h> ... int x = 137; thrust::identity<int> id; assert(x == id(x));
See also
- Template Parameters
T – No requirements on
T
.