Public Types | Public Member Functions | List of all members
thrust::bit_or< T > Struct Template Reference

#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__ T operator() (const T &lhs, const T &rhs) const

Detailed Description

template<typename T>
struct thrust::bit_or< T >

bit_or is a function object. Specifically, it is an Adaptable Binary Function. If f is an object of class bit_and<T>, and x and y are objects of class T, then f(x,y) returns x|y.

Template Parameters
Tis 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 bit_or to take the bitwise OR of one device_vector of ints by another.

#include <thrust/fill.h>
const int N = 1000;
thrust::sequence(V1.begin(), V1.end(), 1);
thrust::fill(V2.begin(), V2.end(), 13);
thrust::transform(V1.begin(), V1.end(), V2.begin(), V3.begin(),
// V3 is now {1|13, 2|13, 3|13, ..., 1000|13}
See also

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