Template Struct pair¶
Defined in File pair.h
Struct Documentation¶
-
template<typename
T1, typenameT2>
structpair¶ pairis a generic data structure encapsulating a heterogeneous pair of values.- Template Parameters
T1: The type ofpair'sfirst object type. There are no requirements on the type ofT1.T1’s type is provided bypair::first_type.T2: The type ofpair'ssecond object type. There are no requirements on the type ofT2.T2’s type is provided bypair::second_type.
Public Types
-
typedef T1
first_type¶ first_typeis the type ofpair'sfirst object type.
-
typedef T2
second_type¶ second_typeis the type ofpair'ssecond object type.
Public Functions
-
__host__ __device__ thrust::pair::pair(void) pair'sdefault constructor constructsfirstandsecondusingfirst_type&second_type'sdefault constructors, respectively.
-
__host__ __device__ thrust::pair::pair(const T1 & x, const T2 & y) This constructor accepts two objects to copy into this
pair.- Parameters
x: The object to copy intofirst.y: The object to copy intosecond.
-
template<typename U1, typename U2>__host__ __device__ thrust::pair::pair(const pair < U1, U2 > & p) This copy constructor copies from a
pairwhose types are convertible to thispair'sfirst_typeandsecond_type, respectively.- Parameters
p: Thepairto copy from.
- Template Parameters
U1: is convertible tofirst_type.U2: is convertible tosecond_type.
-
template<typename U1, typename U2>__host__ __device__ thrust::pair::pair(const std::pair< U1, U2 > & p) This copy constructor copies from a
std::pairwhose types are convertible to thispair'sfirst_typeandsecond_type, respectively.- Parameters
p: Thestd::pairto copy from.
- Template Parameters
U1: is convertible tofirst_type.U2: is convertible tosecond_type.
-
__host__ __device__ void thrust::pair::swap(pair & p) swapswaps the elements of twopairs.- Parameters
p: The otherpairwith which to swap.
Public Members
-
first_type
first¶ The
pair'sfirst object.
-
second_type
second¶ The
pair'ssecond object.