Skip to main content Link Menu Expand (external link) Document Search Copy Copied

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:

Function Parameters:

  • x The first pair to compare.
  • y The second pair 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:

Function Parameters:

  • x The first pair to compare.
  • y The second pair 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:

Function Parameters:

  • x The first pair to compare.
  • y The second pair 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:

Function Parameters:

  • x The first pair to compare.
  • y The second pair 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:

Function Parameters:

  • x The first pair to compare.
  • y The second pair 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:

Function Parameters:

  • x The first pair to compare.
  • y The second pair 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 pairs.

Function Parameters:

  • x The first pair to swap.
  • y The second pair 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 of T1.
  • T2 There are no requirements on the type of T2.

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.