Thrust
|
#include <thrust/functional.h>
Public Types | |
typedef T | first_argument_type |
The type of the function object's first argument. | |
typedef T | second_argument_type |
The type of the function object's second argument. | |
typedef T | result_type |
The type of the function object's result;. | |
Public Member Functions | |
__thrust_exec_check_disable__ __host__ __device__ constexpr T | operator() (const T &lhs, const T &rhs) const |
plus
is a function object. Specifically, it is an Adaptable Binary Function. If f
is an object of class plus<T>
, and x
and y
are objects of class T
, then f(x,y)
returns x+y
.
T | is a model of Assignable, and if x and y are objects of type T , then x+y must be defined and must have a return type that is convertible to T . |
The following code snippet demonstrates how to use plus
to sum two device_vectors of floats
.