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, integer_sequence< size_t, _Indexes1...>, integer_sequence< size_t, _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
86  : first(), second()
87  { // default construct
88  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
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
97  : first(_Val1), second(_Val2)
98  { // construct from specified values
99  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
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
108  : first(_Val1), second(_Val2)
109  { // construct from specified values
110  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
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
122  : first(_Right.first), second(_Right.second)
123  { // construct from compatible pair
124  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
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
133  : first(_Right.first), second(_Right.second)
134  { // construct from compatible pair
135  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
template<class _Ty1, class _Ty2>
template<class _Tuple1 , class _Tuple2 , size_t... _Indexes1, size_t... _Indexes2>
pair< _Ty1, _Ty2 >::pair ( _Tuple1 &  _Val1,
_Tuple2 &  _Val2,
integer_sequence< size_t, _Indexes1...>  ,
integer_sequence< size_t, _Indexes2...>   
)
inline
1178  : first(_STD get<_Indexes1>(_STD move(_Val1))...),
1179  second(_STD get<_Indexes2>(_STD move(_Val2))...)
1180  { // construct from pair of tuples
1181  (void) _Val1; // TRANSITION, VSO#181496
1182  (void) _Val2;
1183  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
template<class _Ty1, class _Ty2>
template<class... _Types1, class... _Types2>
pair< _Ty1, _Ty2 >::pair ( piecewise_construct_t  ,
tuple< _Types1...>  _Val1,
tuple< _Types2...>  _Val2 
)
inline
1193  : pair(_Val1, _Val2,
1194  make_integer_sequence<size_t, sizeof...(_Types1)>(),
1195  make_integer_sequence<size_t, sizeof...(_Types2)>())
1196  { // construct from pair of tuples
1197  }
__make_integer_seq< integer_sequence, _Ty, _Size > make_integer_sequence
Definition: type_traits:1245
constexpr pair()
Definition: utility:85
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
140  { // assign from compatible pair
141  first = _Right.first;
142  second = _Right.second;
143  return (*this);
144  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
template<class _Ty1, class _Ty2>
template<class _Other1 , class _Other2 >
_Myt& pair< _Ty1, _Ty2 >::operator= ( pair< _Other1, _Other2 > &&  _Right)
inline
220  { // assign from moved compatible pair
221  first = _STD forward<_Other1>(_Right.first);
222  second = _STD forward<_Other2>(_Right.second);
223  return (*this);
224  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
template<class _Ty1, class _Ty2>
_Myt& pair< _Ty1, _Ty2 >::operator= ( _Myt &&  _Right)
inline
229  { // assign from moved pair
230  first = _STD forward<_Ty1>(_Right.first);
231  second = _STD forward<_Ty2>(_Right.second);
232  return (*this);
233  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty1, class _Ty2>
_Myt& pair< _Ty1, _Ty2 >::operator= ( const _Myt _Right)
inline
236  { // assign from copied pair
237  first = _Right.first;
238  second = _Right.second;
239  return (*this);
240  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Val2)
inline
172  { // construct from moved values
173  }
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Val2)
inline
186  { // construct from moved values
187  }
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Right.second)
inline
200  { // construct from moved compatible pair
201  }
template<class _Ty1, class _Ty2>
constexpr _Other1 ::value pair< _Ty1, _Ty2 >::second ( _STD forward< _Other2 >  _Right.second)
inline
214  { // construct from moved compatible pair
215  }
template<class _Ty1, class _Ty2>
void pair< _Ty1, _Ty2 >::swap ( _Myt _Right)
inline
248  { // exchange contents with _Right
249  if (this != &_Right)
250  { // different, worth swapping
251  _Swap_adl(first, _Right.first);
252  _Swap_adl(second, _Right.second);
253  }
254  }
_Ty2 second
Definition: utility:243
_Ty1 first
Definition: utility:242
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:56
constexpr const _Ty &() _Right
Definition: algorithm:3591

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: