thrust
Public Types | Public Member Functions | Public Attributes | List of all members
thrust::pair< T1, T2 > Struct Template Reference

#include <pair.h>

Public Types

typedef T1 first_type
 
typedef T2 second_type
 

Public Member Functions

__host__ __device__ pair (void)
 
__host__ __device__ pair (const T1 &x, const T2 &y)
 
template<typename U1 , typename U2 >
__host__ __device__ pair (const pair< U1, U2 > &p)
 
template<typename U1 , typename U2 >
__host__ __device__ pair (const std::pair< U1, U2 > &p)
 
__host__ __device__ void swap (pair &p)
 

Public Attributes

first_type first
 
second_type second
 

Detailed Description

template<typename T1, typename T2>
struct thrust::pair< T1, T2 >

pair is a generic data structure encapsulating a heterogeneous pair of values.

Template Parameters
T1The type of pair's first object type. There are no requirements on the type of T1. T1's type is provided by pair::first_type.
T2The type of pair's second object type. There are no requirements on the type of T2. T2's type is provided by pair::second_type.

Member Typedef Documentation

template<typename T1, typename T2>
typedef T1 thrust::pair< T1, T2 >::first_type

first_type is the type of pair's first object type.

template<typename T1, typename T2>
typedef T2 thrust::pair< T1, T2 >::second_type

second_type is the type of pair's second object type.

Constructor & Destructor Documentation

template<typename T1, typename T2>
__host__ __device__ thrust::pair< T1, T2 >::pair ( void  )

pair's default constructor constructs first and second using first_type & second_type's default constructors, respectively.

template<typename T1, typename T2>
__host__ __device__ thrust::pair< T1, T2 >::pair ( const T1 &  x,
const T2 &  y 
)
inline

This constructor accepts two objects to copy into this pair.

Parameters
xThe object to copy into first.
yThe object to copy into second.
template<typename T1, typename T2>
template<typename U1 , typename U2 >
__host__ __device__ thrust::pair< T1, T2 >::pair ( const pair< U1, U2 > &  p)
inline

This copy constructor copies from a pair whose types are convertible to this pair's first_type and second_type, respectively.

Parameters
pThe pair to copy from.
Template Parameters
U1is convertible to first_type.
U2is convertible to second_type.
template<typename T1, typename T2>
template<typename U1 , typename U2 >
__host__ __device__ thrust::pair< T1, T2 >::pair ( const std::pair< U1, U2 > &  p)
inline

This copy constructor copies from a std::pair whose types are convertible to this pair's first_type and second_type, respectively.

Parameters
pThe std::pair to copy from.
Template Parameters
U1is convertible to first_type.
U2is convertible to second_type.

Member Function Documentation

template<typename T1, typename T2>
__host__ __device__ void thrust::pair< T1, T2 >::swap ( pair< T1, T2 > &  p)
inline

swap swaps the elements of two pairs.

Parameters
pThe other pair with which to swap.

Member Data Documentation

template<typename T1, typename T2>
first_type thrust::pair< T1, T2 >::first
template<typename T1, typename T2>
second_type thrust::pair< T1, T2 >::second

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