.TH "std::pair< _T1, _T2 >" 3cxx "Wed Jul 28 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::pair< _T1, _T2 > \- Struct holding two objects of arbitrary type\&. .SH SYNOPSIS .br .PP .PP Inherits __pair_base< _T1, _T2 >\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _T1 \fBfirst_type\fP" .br .RI "The type of the \fCfirst\fP member\&. " .ti -1c .RI "typedef _T2 \fBsecond_type\fP" .br .RI "The type of the \fCsecond\fP member\&. " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "template, __is_implicitly_default_constructible< _U2 >> ::value, bool >::type = true> constexpr \fBpair\fP ()" .br .ti -1c .RI "template() &&_PCCP::template _ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = true> constexpr \fBpair\fP (_U1 &&__x, _U2 &&__y)" .br .ti -1c .RI "template() &&!_PCCP::template _ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = false> constexpr \fBpair\fP (_U1 &&__x, _U2 &&__y)" .br .ti -1c .RI "template(), bool >::type = true> constexpr \fBpair\fP (_U1 &&__x, const _T2 &__y)" .br .ti -1c .RI "template(), bool >::type = false> constexpr \fBpair\fP (_U1 &&__x, const _T2 &__y)" .br .ti -1c .RI "template() &&_PCCP::template _ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = true> constexpr \fBpair\fP (const _T1 &__a, const _T2 &__b)" .br .RI "Construct from two const lvalues, allowing implicit conversions\&. " .ti -1c .RI "template() &&!_PCCP::template _ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = false> constexpr \fBpair\fP (const _T1 &__a, const _T2 &__b)" .br .RI "Construct from two const lvalues, disallowing implicit conversions\&. " .ti -1c .RI "template(), bool >::type = true> constexpr \fBpair\fP (const _T1 &__x, _U2 &&__y)" .br .ti -1c .RI "template(), bool >::type = false> \fBpair\fP (const _T1 &__x, _U2 &&__y)" .br .ti -1c .RI "constexpr \fBpair\fP (const \fBpair\fP &)=default" .br .RI "Copy constructor\&. " .ti -1c .RI "template::template _ConstructiblePair< _U1, _U2 >() &&_PCCFP< _U1, _U2 >::template _ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = true> constexpr \fBpair\fP (const \fBpair\fP< _U1, _U2 > &__p)" .br .ti -1c .RI "template::template _ConstructiblePair< _U1, _U2 >() &&!_PCCFP< _U1, _U2 >::template _ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = false> constexpr \fBpair\fP (const \fBpair\fP< _U1, _U2 > &__p)" .br .ti -1c .RI "constexpr \fBpair\fP (\fBpair\fP &&)=default" .br .RI "Move constructor\&. " .ti -1c .RI "template::template _MoveConstructiblePair< _U1, _U2 >() &&_PCCFP< _U1, _U2 >::template _ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = true> constexpr \fBpair\fP (\fBpair\fP< _U1, _U2 > &&__p)" .br .ti -1c .RI "template::template _MoveConstructiblePair< _U1, _U2 >() &&!_PCCFP< _U1, _U2 >::template _ImplicitlyMoveConvertiblePair< _U1, _U2 >(), bool >::type = false> constexpr \fBpair\fP (\fBpair\fP< _U1, _U2 > &&__p)" .br .ti -1c .RI "template constexpr \fBpair\fP (\fBpiecewise_construct_t\fP, \fBtuple\fP< _Args1\&.\&.\&. >, \fBtuple\fP< _Args2\&.\&.\&. >)" .br .ti -1c .RI "template constexpr \fBenable_if\fP< __and_< \fBis_assignable\fP< _T1 &, const _U1 & >, \fBis_assignable\fP< _T2 &, const _U2 & > >::value, \fBpair\fP & >::type \fBoperator=\fP (const \fBpair\fP< _U1, _U2 > &__p)" .br .ti -1c .RI "template constexpr \fBenable_if\fP< __and_< \fBis_assignable\fP< _T1 &, _U1 && >, \fBis_assignable\fP< _T2 &, _U2 && > >::value, \fBpair\fP & >::type \fBoperator=\fP (\fBpair\fP< _U1, _U2 > &&__p)" .br .ti -1c .RI "constexpr \fBpair\fP & \fBoperator=\fP (typename \fBconditional\fP< __and_< \fBis_copy_assignable\fP< _T1 >, \fBis_copy_assignable\fP< _T2 >>::value, const \fBpair\fP &, const __nonesuch & >::type __p)" .br .ti -1c .RI "constexpr \fBpair\fP & \fBoperator=\fP (typename \fBconditional\fP< __and_< \fBis_move_assignable\fP< _T1 >, \fBis_move_assignable\fP< _T2 >>::value, \fBpair\fP &&, __nonesuch && >::type __p) noexcept(__and_< \fBis_nothrow_move_assignable\fP< _T1 >, \fBis_nothrow_move_assignable\fP< _T2 >>::value)" .br .ti -1c .RI "constexpr void \fBswap\fP (\fBpair\fP &__p) noexcept(__and_< __is_nothrow_swappable< _T1 >, __is_nothrow_swappable< _T2 >>::value)" .br .RI "Swap the first members and then the second members\&. " .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "_T1 \fBfirst\fP" .br .RI "The first member\&. " .ti -1c .RI "_T2 \fBsecond\fP" .br .RI "The second member\&. " .in -1c .SS "Related Functions" (Note that these are not member functions\&.) .in +1c .ti -1c .RI "template constexpr \fBpair\fP< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > \fBmake_pair\fP (_T1 &&__x, _T2 &&__y)" .br .RI "A convenience wrapper for creating a pair from two objects\&. " .in -1c .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "template constexpr bool \fBoperator==\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &__y)" .br .ti -1c .RI "template constexpr bool \fBoperator<\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &__y)" .br .ti -1c .RI "template constexpr bool \fBoperator!=\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &__y)" .br .RI "Uses \fCoperator==\fP to find the result\&. " .ti -1c .RI "template constexpr bool \fBoperator>\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &__y)" .br .RI "Uses \fCoperator<\fP to find the result\&. " .ti -1c .RI "template constexpr bool \fBoperator<=\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &__y)" .br .RI "Uses \fCoperator<\fP to find the result\&. " .ti -1c .RI "template constexpr bool \fBoperator>=\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &__y)" .br .RI "Uses \fCoperator<\fP to find the result\&. " .ti -1c .RI "template constexpr \fBenable_if\fP< __and_< __is_swappable< _T1 >, __is_swappable< _T2 > >::value >::type \fBswap\fP (\fBpair\fP< _T1, _T2 > &__x, \fBpair\fP< _T1, _T2 > &__y) noexcept(noexcept(__x\&.swap(__y)))" .br .in -1c .in -1c .SH "Detailed Description" .PP .SS "template .br struct std::pair< _T1, _T2 >" Struct holding two objects of arbitrary type\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_T1\fP Type of first object\&. .br \fI_T2\fP Type of second object\&. .RE .PP https://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html .PP Definition at line 211 of file stl_pair\&.h\&. .SH "Member Typedef Documentation" .PP .SS "template typedef _T1 \fBstd::pair\fP< _T1, _T2 >::\fBfirst_type\fP" .PP The type of the \fCfirst\fP member\&. .PP Definition at line 214 of file stl_pair\&.h\&. .SS "template typedef _T2 \fBstd::pair\fP< _T1, _T2 >::\fBsecond_type\fP" .PP The type of the \fCsecond\fP member\&. .PP Definition at line 215 of file stl_pair\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template template, __is_implicitly_default_constructible< _U2 >> ::value, bool >::type = true> constexpr \fBstd::pair\fP< _T1, _T2 >::\fBpair\fP ()\fC [inline]\fP, \fC [constexpr]\fP" The default constructor creates \fCfirst\fP and \fCsecond\fP using their respective default constructors\&. .br .PP Definition at line 232 of file stl_pair\&.h\&. .SS "template template() &&_PCCP::template _ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = true> constexpr \fBstd::pair\fP< _T1, _T2 >::\fBpair\fP (const _T1 & __a, const _T2 & __b)\fC [inline]\fP, \fC [constexpr]\fP" .PP Construct from two const lvalues, allowing implicit conversions\&. .PP Definition at line 266 of file stl_pair\&.h\&. .SS "template template() &&!_PCCP::template _ImplicitlyConvertiblePair< _U1, _U2 >(), bool >::type = false> constexpr \fBstd::pair\fP< _T1, _T2 >::\fBpair\fP (const _T1 & __a, const _T2 & __b)\fC [inline]\fP, \fC [explicit]\fP, \fC [constexpr]\fP" .PP Construct from two const lvalues, disallowing implicit conversions\&. .PP Definition at line 276 of file stl_pair\&.h\&. .SS "template constexpr \fBstd::pair\fP< _T1, _T2 >::\fBpair\fP (const \fBpair\fP< _T1, _T2 > &)\fC [constexpr]\fP, \fC [default]\fP" .PP Copy constructor\&. .SS "template constexpr \fBstd::pair\fP< _T1, _T2 >::\fBpair\fP (\fBpair\fP< _T1, _T2 > &&)\fC [constexpr]\fP, \fC [default]\fP" .PP Move constructor\&. .SH "Member Function Documentation" .PP .SS "template constexpr void \fBstd::pair\fP< _T1, _T2 >::swap (\fBpair\fP< _T1, _T2 > & __p)\fC [inline]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP Swap the first members and then the second members\&. .PP Definition at line 439 of file stl_pair\&.h\&. .PP Referenced by std::pair< _T1, _T2 >::swap()\&. .SH "Member Data Documentation" .PP .SS "template _T1 \fBstd::pair\fP< _T1, _T2 >::first" .PP The first member\&. .PP Definition at line 217 of file stl_pair\&.h\&. .PP Referenced by std::_Temporary_buffer< _ForwardIterator, _Tp >::_Temporary_buffer(), __gnu_parallel::__find_template(), std::__sample(), std::set< _Key, _Compare, _Alloc >::insert(), std::pair< _T1, _T2 >::operator<(), and std::pair< _T1, _T2 >::operator==()\&. .SS "template _T2 \fBstd::pair\fP< _T1, _T2 >::second" .PP The second member\&. .PP Definition at line 218 of file stl_pair\&.h\&. .PP Referenced by std::__sample(), std::set< _Key, _Compare, _Alloc >::insert(), std::pair< _T1, _T2 >::operator<(), and std::pair< _T1, _T2 >::operator==()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.