libstdc++
std::pair< _T1, _T2 > Struct Template Reference

Inherits __pair_base< _T1, _T2 >.

Public Types

typedef _T1 first_type
 
typedef _T2 second_type
 

Public Member Functions

template<typename _U1 = _T1, typename _U2 = _T2, typename enable_if< __and_< __is_implicitly_default_constructible< _U1 >, __is_implicitly_default_constructible< _U2 >>::value, bool >::type = true>
constexpr pair ()
 
template<typename _U1 = _T1, typename _U2 = _T2, typename enable_if< _PCCP::template_ConstructiblePair< _U1, _U2 >()&&_PCCP::template_ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = true>
constexpr pair (const _T1 &__a, const _T2 &__b)
 
template<typename _U1 = _T1, typename _U2 = _T2, typename enable_if< _PCCP::template_ConstructiblePair< _U1, _U2 >()&&!_PCCP::template_ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = false>
constexpr pair (const _T1 &__a, const _T2 &__b)
 
template<typename _U1 , typename _U2 , typename enable_if< _PCCFP< _U1, _U2 >::template_ConstructiblePair< _U1, _U2 >()&&_PCCFP< _U1, _U2 >::template_ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = true>
constexpr pair (const pair< _U1, _U2 > &__p)
 
template<typename _U1 , typename _U2 , typename enable_if< _PCCFP< _U1, _U2 >::template_ConstructiblePair< _U1, _U2 >()&&!_PCCFP< _U1, _U2 >::template_ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = false>
constexpr pair (const pair< _U1, _U2 > &__p)
 
constexpr pair (const pair &)=default
 
constexpr pair (pair &&)=default
 
template<typename _U1 , typename enable_if< _PCCP::template_MoveCopyPair< true, _U1, _T2 >(), bool >::type = true>
constexpr pair (_U1 &&__x, const _T2 &__y)
 
template<typename _U1 , typename enable_if< _PCCP::template_MoveCopyPair< false, _U1, _T2 >(), bool >::type = false>
constexpr pair (_U1 &&__x, const _T2 &__y)
 
template<typename _U2 , typename enable_if< _PCCP::template_CopyMovePair< true, _T1, _U2 >(), bool >::type = true>
constexpr pair (const _T1 &__x, _U2 &&__y)
 
template<typename _U2 , typename enable_if< _PCCP::template_CopyMovePair< false, _T1, _U2 >(), bool >::type = false>
 pair (const _T1 &__x, _U2 &&__y)
 
template<typename _U1 , typename _U2 , typename enable_if< _PCCP::template_MoveConstructiblePair< _U1, _U2 >()&&_PCCP::template_ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = true>
constexpr pair (_U1 &&__x, _U2 &&__y)
 
template<typename _U1 , typename _U2 , typename enable_if< _PCCP::template_MoveConstructiblePair< _U1, _U2 >()&&!_PCCP::template_ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = false>
constexpr pair (_U1 &&__x, _U2 &&__y)
 
template<typename _U1 , typename _U2 , typename enable_if< _PCCFP< _U1, _U2 >::template_MoveConstructiblePair< _U1, _U2 >()&&_PCCFP< _U1, _U2 >::template_ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = true>
constexpr pair (pair< _U1, _U2 > &&__p)
 
template<typename _U1 , typename _U2 , typename enable_if< _PCCFP< _U1, _U2 >::template_MoveConstructiblePair< _U1, _U2 >()&&!_PCCFP< _U1, _U2 >::template_ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = false>
constexpr pair (pair< _U1, _U2 > &&__p)
 
template<typename... _Args1, typename... _Args2>
constexpr pair (piecewise_construct_t, tuple< _Args1...>, tuple< _Args2...>)
 
constexpr void noexcept (__and_< __is_nothrow_swappable< _T1 >, __is_nothrow_swappable< _T2 >>::value)
 
constexpr pairoperator= (typename conditional< __and_< is_copy_assignable< _T1 >, is_copy_assignable< _T2 >>::value, const pair &, const __nonesuch & >::type __p)
 
constexpr pairoperator= (typename conditional< __and_< is_move_assignable< _T1 >, is_move_assignable< _T2 >>::value, pair &&, __nonesuch && >::type __p) noexcept(__and_< is_nothrow_move_assignable< _T1 >, is_nothrow_move_assignable< _T2 >>::value)
 
template<typename _U1 , typename _U2 >
constexpr enable_if< __and_
< is_assignable< _T1 &, const
_U1 & >, is_assignable< _T2
&, const _U2 & > >::value,
pair & >::type 
operator= (const pair< _U1, _U2 > &__p)
 
template<typename _U1 , typename _U2 >
constexpr enable_if< __and_
< is_assignable< _T1 &, _U1 && >
, is_assignable< _T2 &, _U2 && >
>::value, pair & >::type 
operator= (pair< _U1, _U2 > &&__p)
 

Public Attributes

_T1 first
 
_T2 second
 

Related Functions

(Note that these are not member functions.)

template<typename _T1 , typename _T2 >
constexpr pair< typename
__decay_and_strip< _T1 >
::__type, typename
__decay_and_strip< _T2 >
::__type > 
make_pair (_T1 &&__x, _T2 &&__y)
 
template<typename _T1 , typename _T2 >
constexpr bool operator== (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename _T1 , typename _T2 >
constexpr bool operator< (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename _T1 , typename _T2 >
constexpr bool operator!= (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename _T1 , typename _T2 >
constexpr bool operator> (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename _T1 , typename _T2 >
constexpr bool operator<= (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename _T1 , typename _T2 >
constexpr bool operator>= (const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
 
template<typename _T1 , typename _T2 >
constexpr enable_if< __and_
< __is_swappable< _T1 >
, __is_swappable< _T2 >
>::value >::type 
noexcept (noexcept(__x.swap(__y)))
 

Detailed Description

template<typename _T1, typename _T2>
struct std::pair< _T1, _T2 >

Struct holding two objects of arbitrary type.

Template Parameters
_T1Type of first object.
_T2Type of second object.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html

Definition at line 211 of file stl_pair.h.

Member Typedef Documentation

template<typename _T1, typename _T2>
typedef _T1 std::pair< _T1, _T2 >::first_type

The type of the first member.

Definition at line 214 of file stl_pair.h.

template<typename _T1, typename _T2>
typedef _T2 std::pair< _T1, _T2 >::second_type

The type of the second member.

Definition at line 215 of file stl_pair.h.

Constructor & Destructor Documentation

template<typename _T1, typename _T2>
template<typename _U1 = _T1, typename _U2 = _T2, typename enable_if< __and_< __is_implicitly_default_constructible< _U1 >, __is_implicitly_default_constructible< _U2 >>::value, bool >::type = true>
constexpr std::pair< _T1, _T2 >::pair ( )
inline

The default constructor creates first and second using their respective default constructors.

Definition at line 232 of file stl_pair.h.

template<typename _T1, typename _T2>
template<typename _U1 = _T1, typename _U2 = _T2, typename enable_if< _PCCP::template_ConstructiblePair< _U1, _U2 >()&&_PCCP::template_ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = true>
constexpr std::pair< _T1, _T2 >::pair ( const _T1 &  __a,
const _T2 &  __b 
)
inline

Construct from two const lvalues, allowing implicit conversions.

Definition at line 266 of file stl_pair.h.

template<typename _T1, typename _T2>
template<typename _U1 = _T1, typename _U2 = _T2, typename enable_if< _PCCP::template_ConstructiblePair< _U1, _U2 >()&&!_PCCP::template_ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = false>
constexpr std::pair< _T1, _T2 >::pair ( const _T1 &  __a,
const _T2 &  __b 
)
inlineexplicit

Construct from two const lvalues, disallowing implicit conversions.

Definition at line 276 of file stl_pair.h.

template<typename _T1, typename _T2>
constexpr std::pair< _T1, _T2 >::pair ( const pair< _T1, _T2 > &  )
default

Copy constructor.

template<typename _T1, typename _T2>
constexpr std::pair< _T1, _T2 >::pair ( pair< _T1, _T2 > &&  )
default

Move constructor.

Member Function Documentation

template<typename _T1, typename _T2>
constexpr void std::pair< _T1, _T2 >::noexcept ( __and_< __is_nothrow_swappable< _T1 >, __is_nothrow_swappable< _T2 >>::value  )
inline

Swap the first members and then the second members.

Definition at line 440 of file stl_pair.h.

Member Data Documentation


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