thrust
Public Member Functions
thrust::identity< T > Struct Template Reference

#include <functional.h>

Inheritance diagram for thrust::identity< T >:
thrust::unary_function< T, T > unary_function

List of all members.

Public Member Functions

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

Detailed Description

template<typename T>
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 <thrust/functional.h>
  #include <assert.h>
  ...
  int x = 137;
  thrust::identity<int> id;
  assert(x == id(x));
See also:
http://www.sgi.com/tech/stl/identity.html
unary_function

Member Function Documentation

template<typename T>
__host__ __device__ const T& thrust::identity< T >::operator() ( const T &  x) const [inline]

Function call operator. The return value is x.


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