Public Types | Public Member Functions | List of all members
thrust::identity< T > Struct Template Reference

#include <thrust/functional.h>

Public Types

typedef T argument_type
 The type of the function object's first argument.
typedef T result_type
 The type of the function object's result;.

Public Member Functions

__thrust_exec_check_disable__ __host__ __device__ constexpr const T & operator() (const T &x) const

Detailed Description

template<typename T = void>
struct thrust::identity< T >

identity is a Unary Function that represents the identity function: it takes a single argument x, and returns x.

Template Parameters
TNo requirements on T.

The following code snippet demonstrates that identity returns its argument.

#include <assert.h>
int x = 137;
assert(x == id(x));
See also

The documentation for this struct was generated from the following file: