STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | List of all members
pair< _Ty1, _Ty2 > Struct Template Reference

Public Types

typedef pair< _Ty1, _Ty2 > _Myt
 
typedef _Ty1 first_type
 
typedef _Ty2 second_type
 

Public Member Functions

template<class _Uty1 = _Ty1, class _Uty2 = _Ty2, class = enable_if_t<is_default_constructible<_Uty1>::value && is_default_constructible<_Uty2>::value>>
constexpr pair ()
 
template<class _Uty1 = _Ty1, class _Uty2 = _Ty2, class = enable_if_t<is_copy_constructible<_Uty1>::value && is_copy_constructible<_Uty2>::value>, enable_if_t< is_convertible< const _Uty1 &, _Uty1 >::value &&is_convertible< const _Uty2 &, _Uty2 >::value, int > = 0>
constexpr pair (const _Ty1 &_Val1, const _Ty2 &_Val2)
 
template<class _Uty1 = _Ty1, class _Uty2 = _Ty2, class = enable_if_t<is_copy_constructible<_Uty1>::value && is_copy_constructible<_Uty2>::value>, enable_if_t<!is_convertible< const _Uty1 &, _Uty1 >::value||!is_convertible< const _Uty2 &, _Uty2 >::value, int > = 0>
constexpr pair (const _Ty1 &_Val1, const _Ty2 &_Val2)
 
 pair (const pair &)=default
 
 pair (pair &&)=default
 
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, const _Other1&>::value && is_constructible<_Ty2, const _Other2&>::value>, enable_if_t< is_convertible< const _Other1 &, _Ty1 >::value &&is_convertible< const _Other2 &, _Ty2 >::value, int > = 0>
constexpr pair (const pair< _Other1, _Other2 > &_Right)
 
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, const _Other1&>::value && is_constructible<_Ty2, const _Other2&>::value>, enable_if_t<!is_convertible< const _Other1 &, _Ty1 >::value||!is_convertible< const _Other2 &, _Ty2 >::value, int > = 0>
constexpr pair (const pair< _Other1, _Other2 > &_Right)
 
template<class _Other1 , class _Other2 >
_Mytoperator= (const pair< _Other1, _Other2 > &_Right)
 
template<class _Tuple1 , class _Tuple2 , size_t... _Indexes1, size_t... _Indexes2>
 pair (_Tuple1 &_Val1, _Tuple2 &_Val2, index_sequence< _Indexes1...>, index_sequence< _Indexes2...>)
 
template<class... _Types1, class... _Types2>
 pair (piecewise_construct_t, tuple< _Types1...> _Val1, tuple< _Types2...> _Val2)
 
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t< is_convertible< _Other1, _Ty1 >::value &&is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair (_Other1 &&_Val1, _Other2 &&_Val2) _NOEXCEPT_OP((is_nothrow_constructible< _Ty1
 
constexpr _Other1::value second (_STD forward< _Other2 >(_Val2))
 
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t<!is_convertible< _Other1, _Ty1 >::value||!is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair (_Other1 &&_Val1, _Other2 &&_Val2) _NOEXCEPT_OP((is_nothrow_constructible< _Ty1
 
constexpr _Other1::value second (_STD forward< _Other2 >(_Val2))
 
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t< is_convertible< _Other1, _Ty1 >::value &&is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair (pair< _Other1, _Other2 > &&_Right) _NOEXCEPT_OP((is_nothrow_constructible< _Ty1
 
constexpr _Other1::value second (_STD forward< _Other2 >(_Right.second))
 
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t<!is_convertible< _Other1, _Ty1 >::value||!is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair (pair< _Other1, _Other2 > &&_Right) _NOEXCEPT_OP((is_nothrow_constructible< _Ty1
 
constexpr _Other1::value second (_STD forward< _Other2 >(_Right.second))
 
template<class _Other1 , class _Other2 >
_Mytoperator= (pair< _Other1, _Other2 > &&_Right)
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT_OP((is_nothrow_move_assignable< _Ty1 >
 
_Mytoperator= (const _Myt &_Right)
 
void swap (_Myt &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty1 >
 

Public Attributes

_Ty1 first
 
_Ty2 second
 

Member Typedef Documentation

template<class _Ty1, class _Ty2>
typedef pair<_Ty1, _Ty2> pair< _Ty1, _Ty2 >::_Myt
template<class _Ty1, class _Ty2>
typedef _Ty1 pair< _Ty1, _Ty2 >::first_type
template<class _Ty1, class _Ty2>
typedef _Ty2 pair< _Ty1, _Ty2 >::second_type

Constructor & Destructor Documentation

template<class _Ty1, class _Ty2>
template<class _Uty1 = _Ty1, class _Uty2 = _Ty2, class = enable_if_t<is_default_constructible<_Uty1>::value && is_default_constructible<_Uty2>::value>>
constexpr pair< _Ty1, _Ty2 >::pair ( )
inline
103  : first(), second()
104  { // default construct
105  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
template<class _Uty1 = _Ty1, class _Uty2 = _Ty2, class = enable_if_t<is_copy_constructible<_Uty1>::value && is_copy_constructible<_Uty2>::value>, enable_if_t< is_convertible< const _Uty1 &, _Uty1 >::value &&is_convertible< const _Uty2 &, _Uty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( const _Ty1 &  _Val1,
const _Ty2 &  _Val2 
)
inline
114  : first(_Val1), second(_Val2)
115  { // construct from specified values
116  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
template<class _Uty1 = _Ty1, class _Uty2 = _Ty2, class = enable_if_t<is_copy_constructible<_Uty1>::value && is_copy_constructible<_Uty2>::value>, enable_if_t<!is_convertible< const _Uty1 &, _Uty1 >::value||!is_convertible< const _Uty2 &, _Uty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( const _Ty1 &  _Val1,
const _Ty2 &  _Val2 
)
inlineexplicit
125  : first(_Val1), second(_Val2)
126  { // construct from specified values
127  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
pair< _Ty1, _Ty2 >::pair ( const pair< _Ty1, _Ty2 > &  )
default
template<class _Ty1, class _Ty2>
pair< _Ty1, _Ty2 >::pair ( pair< _Ty1, _Ty2 > &&  )
default
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, const _Other1&>::value && is_constructible<_Ty2, const _Other2&>::value>, enable_if_t< is_convertible< const _Other1 &, _Ty1 >::value &&is_convertible< const _Other2 &, _Ty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( const pair< _Other1, _Other2 > &  _Right)
inline
139  : first(_Right.first), second(_Right.second)
140  { // construct from compatible pair
141  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, const _Other1&>::value && is_constructible<_Ty2, const _Other2&>::value>, enable_if_t<!is_convertible< const _Other1 &, _Ty1 >::value||!is_convertible< const _Other2 &, _Ty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( const pair< _Other1, _Other2 > &  _Right)
inlineexplicit
150  : first(_Right.first), second(_Right.second)
151  { // construct from compatible pair
152  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
template<class _Tuple1 , class _Tuple2 , size_t... _Indexes1, size_t... _Indexes2>
pair< _Ty1, _Ty2 >::pair ( _Tuple1 &  _Val1,
_Tuple2 &  _Val2,
index_sequence< _Indexes1...>  ,
index_sequence< _Indexes2...>   
)
inline
1138  : first(_STD get<_Indexes1>(_STD move(_Val1))...),
1139  second(_STD get<_Indexes2>(_STD move(_Val2))...)
1140  { // construct from pair of tuples
1141  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Ty1, class _Ty2>
template<class... _Types1, class... _Types2>
pair< _Ty1, _Ty2 >::pair ( piecewise_construct_t  ,
tuple< _Types1...>  _Val1,
tuple< _Types2...>  _Val2 
)
inline
1152  : pair(_Val1, _Val2,
1155  { // construct from pair of tuples
1156  }
make_index_sequence< sizeof...(_Types)> index_sequence_for
Definition: type_traits:1293
constexpr pair()
Definition: utility:102
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t< is_convertible< _Other1, _Ty1 >::value &&is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( _Other1 &&  _Val1,
_Other2 &&  _Val2 
)
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t<!is_convertible< _Other1, _Ty1 >::value||!is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( _Other1 &&  _Val1,
_Other2 &&  _Val2 
)
explicit
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t< is_convertible< _Other1, _Ty1 >::value &&is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( pair< _Other1, _Other2 > &&  _Right)
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 , class = enable_if_t<is_constructible<_Ty1, _Other1>::value && is_constructible<_Ty2, _Other2>::value>, enable_if_t<!is_convertible< _Other1, _Ty1 >::value||!is_convertible< _Other2, _Ty2 >::value, int > = 0>
constexpr pair< _Ty1, _Ty2 >::pair ( pair< _Other1, _Other2 > &&  _Right)
explicit

Member Function Documentation

template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 >
_Myt& pair< _Ty1, _Ty2 >::operator= ( const pair< _Other1, _Other2 > &  _Right)
inline
157  { // assign from compatible pair
158  first = _Right.first;
159  second = _Right.second;
160  return (*this);
161  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 >
_Myt& pair< _Ty1, _Ty2 >::operator= ( pair< _Other1, _Other2 > &&  _Right)
inline
237  { // assign from moved compatible pair
238  first = _STD forward<_Other1>(_Right.first);
239  second = _STD forward<_Other2>(_Right.second);
240  return (*this);
241  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
template<class _Ty1, class _Ty2>
_Myt& pair< _Ty1, _Ty2 >::operator= ( _Myt &&  _Right)
inline
246  { // assign from moved pair
247  first = _STD forward<_Ty1>(_Right.first);
248  second = _STD forward<_Ty2>(_Right.second);
249  return (*this);
250  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
_STD_BEGIN const _Ty & _Right
Definition: utility:22
template<class _Ty1, class _Ty2>
_Myt& pair< _Ty1, _Ty2 >::operator= ( const _Myt _Right)
inline
253  { // assign from copied pair
254  first = _Right.first;
255  second = _Right.second;
256  return (*this);
257  }
_Ty2 second
Definition: utility:271
_Ty1 first
Definition: utility:270
_STD_BEGIN const _Ty & _Right
Definition: utility:22
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Val2)
inline
189  { // construct from moved values
190  }
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Val2)
inline
203  { // construct from moved values
204  }
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Right.second)
inline
217  { // construct from moved compatible pair
218  }
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Right.second)
inline
231  { // construct from moved compatible pair
232  }
template<class _Ty1, class _Ty2>
void pair< _Ty1, _Ty2 >::swap ( _Myt _Right)
inline
262  { // exchange contents with _Right
263  if (this != _STD addressof(_Right))
264  { // different, worth swapping
265  _Swap_adl(first, _Right.first);
266  _Swap_adl(second, _Right.second);
267  }
268  }
_Ty2 second
Definition: utility:271
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Ty1 first
Definition: utility:270
_STD_BEGIN const _Ty & _Right
Definition: utility:22
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:73

Member Data Documentation

template<class _Ty1, class _Ty2>
_Ty1 pair< _Ty1, _Ty2 >::first
template<class _Ty1, class _Ty2>
_Ty2 pair< _Ty1, _Ty2 >::second

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