Public Types | Public Member Functions | List of all members
thrust::maximum< 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__ constexpr T operator() (const T &lhs, const T &rhs) const

Detailed Description

template<typename T = void>
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

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