thrust::project1st

Defined in thrust/functional.h

template<typename T1 = void, typename T2 = void>
struct project1st

project1st is a function object that takes two arguments and returns its first argument; the second argument is unused. It is essentially a generalization of identity to the case of a Binary Function.

#include <thrust/functional.h>
#include <assert.h>
...
int x =  137;
int y = -137;
thrust::project1st<int> pj1;
assert(x == pj1(x,y));

See also

identity

See also

project2nd

Public Functions

inline constexpr const T1 &operator()(const T1 &lhs, const T2&) const

Function call operator. The return value is lhs.