thrust::project2nd

Defined in thrust/functional.h

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

project2nd is a function object that takes two arguments and returns its second argument; the first 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::project2nd<int> pj2;
assert(y == pj2(x,y));

See also

identity

See also

project1st

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 T2 result_type

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

Public Functions

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

Function call operator. The return value is rhs.