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

See also

binary_function

Public Types

typedef T1 first_argument_type

The type of the function object’s first argument. deprecated [Since 2.6].

typedef T2 second_argument_type

The type of the function object’s second argument. deprecated [Since 2.6].

typedef T1 result_type

The type of the function object’s result; deprecated [Since 2.6].

Public Functions

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

Function call operator. The return value is lhs.