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

#include <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

__host__ __device__ T operator() (const T &lhs, const T &rhs) const

Detailed Description

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

maximum is a function object that takes two arguments and returns the greater of the two. Specifically, it is an Adaptable Binary Function. If f is an object of class maximum<T> and x and y are objects of class T f(x,y) returns x if x > y and y, otherwise.

Template Parameters
Tis a model of LessThan Comparable.

The following code snippet demonstrates that maximum returns its greater argument.

#include <assert.h>
int x = 137;
int y = -137;
assert(x == mx(x,y));
See Also

Member Function Documentation

template<typename T>
__host__ __device__ T thrust::maximum< T >::operator() ( const T &  lhs,
const T &  rhs 
) const

Function call operator. The return value is rhs < lhs ? lhs : rhs.

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