Pair
template <typename T1, typename T2> struct thrust::pair;
template <size_t N, class T> struct thrust::tuple_element;
template <typename Pair> struct thrust::tuple_size;
template <typename T1, typename T2> __host__ __device__ bool thrust::operator==(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ bool thrust::operator<(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ bool thrust::operator!=(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ bool thrust::operator>(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ bool thrust::operator<=(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ bool thrust::operator>=(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ void thrust::swap(pair< T1, T2 > & x, pair< T1, T2 > & y);
template <typename T1, typename T2> __host__ __device__ pair< T1, T2 > thrust::make_pair(T1 x, T2 y);
Member Classes
Struct thrust::pair
Struct thrust::tuple_element
Struct thrust::tuple_size
Functions
Function thrust::operator==
template <typename T1, typename T2> __host__ __device__ bool operator==(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
This operator tests two pairs
for equality.
Template Parameters:
T1
is a model of Equality Comparable.T2
is a model of Equality Comparable.
Function Parameters:
x
The firstpair
to compare.y
The secondpair
to compare.
Returns: true
if and only if x.first == y.first && x.second == y.second
.
Function thrust::operator<
template <typename T1, typename T2> __host__ __device__ bool operator<(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
This operator tests two pairs for ascending ordering.
Template Parameters:
T1
is a model of LessThan Comparable.T2
is a model of LessThan Comparable.
Function Parameters:
x
The firstpair
to compare.y
The secondpair
to compare.
Returns: true
if and only if x.first < y.first || (!(y.first < x.first) && x.second < y.second)
.
Function thrust::operator!=
template <typename T1, typename T2> __host__ __device__ bool operator!=(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
This operator tests two pairs for inequality.
Template Parameters:
T1
is a model of Equality Comparable.T2
is a model of Equality Comparable.
Function Parameters:
x
The firstpair
to compare.y
The secondpair
to compare.
Returns: true
if and only if !(x == y)
.
Function thrust::operator>
template <typename T1, typename T2> __host__ __device__ bool operator>(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
This operator tests two pairs for descending ordering.
Template Parameters:
T1
is a model of LessThan Comparable.T2
is a model of LessThan Comparable.
Function Parameters:
x
The firstpair
to compare.y
The secondpair
to compare.
Returns: true
if and only if y < x
.
Function thrust::operator<=
template <typename T1, typename T2> __host__ __device__ bool operator<=(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
This operator tests two pairs for ascending ordering or equivalence.
Template Parameters:
T1
is a model of LessThan Comparable.T2
is a model of LessThan Comparable.
Function Parameters:
x
The firstpair
to compare.y
The secondpair
to compare.
Returns: true
if and only if !(y < x)
.
Function thrust::operator>=
template <typename T1, typename T2> __host__ __device__ bool operator>=(const pair< T1, T2 > & x, const pair< T1, T2 > & y);
This operator tests two pairs for descending ordering or equivalence.
Template Parameters:
T1
is a model of LessThan Comparable.T2
is a model of LessThan Comparable.
Function Parameters:
x
The firstpair
to compare.y
The secondpair
to compare.
Returns: true
if and only if !(x < y)
.
Function thrust::swap
template <typename T1, typename T2> __host__ __device__ void swap(pair< T1, T2 > & x, pair< T1, T2 > & y);
swap
swaps the contents of two pair
s.
Function Parameters:
x
The firstpair
to swap.y
The secondpair
to swap.
Function thrust::make_pair
template <typename T1, typename T2> __host__ __device__ pair< T1, T2 > make_pair(T1 x, T2 y);
This convenience function creates a pair
from two objects.
Template Parameters:
T1
There are no requirements on the type ofT1
.T2
There are no requirements on the type ofT2
.
Function Parameters:
x
The first object to copy from.y
The second object to copy from.
Returns: A newly-constructed pair
copied from a
and b
.