.TH "std::pair< _T1, _T2 >" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::pair< _T1, _T2 > \- Struct holding two objects of arbitrary type\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits __pair_base< _T1, _T2 >\&. .SS "Public Types" .in +1c .ti -1c .RI "\fBtypedef\fP _T1 \fBfirst_type\fP" .br .RI "The type of the \fCfirst\fP member\&. " .ti -1c .RI "\fBtypedef\fP _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<\fBtypename\fP \fB_U1\fP = _T1, \fBtypename\fP \fB_U2\fP = _T2, \fBtypename\fP \fBenable_if\fP< __and_< __is_implicitly_default_constructible< \fB_U1\fP >, __is_implicitly_default_constructible< \fB_U2\fP > > ::value, bool >::type = true> constexpr \fBpair\fP ()" .br .ti -1c .RI "template<\fBtypename\fP \fB_U2\fP , \fB__enable_if_t\fP< __and_< \fBis_pointer\fP< _T1 >, __not_< \fBis_reference\fP< \fB_U2\fP > >, \fBis_constructible\fP< _T2, \fB_U2\fP >, __not_< \fBis_constructible\fP< _T2, const \fB_U2\fP & > >, \fBis_convertible\fP< \fB_U2\fP, _T2 > >::value, bool > = true> constexpr \fBpair\fP (\fB__zero_as_null_pointer_constant\fP, \fB_U2\fP &&\fB__y\fP,\&.\&.\&.)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U2\fP , \fB__enable_if_t\fP< __and_< \fBis_pointer\fP< _T1 >, __not_< \fBis_reference\fP< \fB_U2\fP > >, \fBis_constructible\fP< _T2, \fB_U2\fP >, __not_< \fBis_constructible\fP< _T2, const \fB_U2\fP & > >, __not_< \fBis_convertible\fP< \fB_U2\fP, _T2 > > >::value, bool > = false> constexpr \fBpair\fP (\fB__zero_as_null_pointer_constant\fP, \fB_U2\fP &&\fB__y\fP,\&.\&.\&.)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fB__enable_if_t\fP< __and_< __not_< \fBis_reference\fP< \fB_U1\fP > >, \fBis_pointer\fP< _T2 >, \fBis_constructible\fP< _T1, \fB_U1\fP >, __not_< \fBis_constructible\fP< _T1, const \fB_U1\fP & > >, \fBis_convertible\fP< \fB_U1\fP, _T1 > >::value, bool > = true> constexpr \fBpair\fP (\fB_U1\fP &&__x, \fB__zero_as_null_pointer_constant\fP,\&.\&.\&.)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fB__enable_if_t\fP< __and_< __not_< \fBis_reference\fP< \fB_U1\fP > >, \fBis_pointer\fP< _T2 >, \fBis_constructible\fP< _T1, \fB_U1\fP >, __not_< \fBis_constructible\fP< _T1, const \fB_U1\fP & > >, __not_< \fBis_convertible\fP< \fB_U1\fP, _T1 > > >::value, bool > = false> constexpr \fBpair\fP (\fB_U1\fP &&__x, \fB__zero_as_null_pointer_constant\fP,\&.\&.\&.)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_MoveConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&_PCCP::template \fB_ImplicitlyMoveConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = true> constexpr \fBpair\fP (\fB_U1\fP &&__x, \fB_U2\fP &&\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_MoveConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&!_PCCP::template \fB_ImplicitlyMoveConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = false> constexpr \fBpair\fP (\fB_U1\fP &&__x, \fB_U2\fP &&\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP = _T1, \fBtypename\fP \fB_U2\fP = _T2, \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_ConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&_PCCP::template \fB_ImplicitlyConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), 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<\fBtypename\fP \fB_U1\fP = _T1, \fBtypename\fP \fB_U2\fP = _T2, \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_ConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&!_PCCP::template \fB_ImplicitlyConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), 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 "constexpr \fBpair\fP (const \fBpair\fP &)=\fBdefault\fP" .br .RI "Copy constructor\&. " .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< \fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_ConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&\fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_ImplicitlyConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = true> constexpr \fBpair\fP (const \fBpair\fP< \fB_U1\fP, \fB_U2\fP > &__p)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< \fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_ConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&!\fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_ImplicitlyConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = false> constexpr \fBpair\fP (const \fBpair\fP< \fB_U1\fP, \fB_U2\fP > &__p)" .br .ti -1c .RI "constexpr \fBpair\fP (\fBpair\fP &&)=\fBdefault\fP" .br .RI "Move constructor\&. " .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< \fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_MoveConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&\fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_ImplicitlyMoveConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = true> constexpr \fBpair\fP (\fBpair\fP< \fB_U1\fP, \fB_U2\fP > &&__p)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< \fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_MoveConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&!\fB_PCCFP\fP< \fB_U1\fP, \fB_U2\fP >::template \fB_ImplicitlyMoveConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = false> constexpr \fBpair\fP (\fBpair\fP< \fB_U1\fP, \fB_U2\fP > &&__p)" .br .ti -1c .RI "template constexpr \fBpair\fP (\fBpiecewise_construct_t\fP, \fBtuple\fP< _Args1\&.\&.\&. >, \fBtuple\fP< _Args2\&.\&.\&. >)" .br .ti -1c .RI "\fBpair\fP & \fBoperator=\fP (__conditional_t< __and_< \fBis_copy_assignable\fP< _T1 >, \fBis_copy_assignable\fP< _T2 > >::value, const \fBpair\fP &, const \fB__nonesuch\fP & > __p)" .br .ti -1c .RI "\fBpair\fP & \fBoperator=\fP (__conditional_t< __and_< \fBis_move_assignable\fP< _T1 >, \fBis_move_assignable\fP< _T2 > >::value, \fBpair\fP &&, \fB__nonesuch\fP && > __p) noexcept(__and_< \fBis_nothrow_move_assignable\fP< _T1 >, \fBis_nothrow_move_assignable\fP< _T2 > >::value)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP > \fBenable_if\fP< __and_< \fBis_assignable\fP< _T1 &, \fBconst_U1\fP & >, \fBis_assignable\fP< _T2 &, \fBconst_U2\fP & > >::value, \fBpair\fP & >::type \fBoperator=\fP (const \fBpair\fP< \fB_U1\fP, \fB_U2\fP > &__p)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP > \fBenable_if\fP< __and_< \fBis_assignable\fP< _T1 &, \fB_U1\fP && >, \fBis_assignable\fP< _T2 &, \fB_U2\fP && > >::value, \fBpair\fP & >::type \fBoperator=\fP (\fBpair\fP< \fB_U1\fP, \fB_U2\fP > &&__p)" .br .ti -1c .RI "constexpr \fBvoid\fP \fBswap\fP (\fBpair\fP &__p) noexcept(__and_< \fB__is_nothrow_swappable\fP< _T1 >, \fB__is_nothrow_swappable\fP< _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 Symbols" (Note that these are not member symbols\&.) .in +1c .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr \fBpair\fP< \fBtypename\fP \fB__decay_and_strip\fP< _T1 >::__type, \fBtypename\fP \fB__decay_and_strip\fP< _T2 >::__type > \fBmake_pair\fP (_T1 &&__x, _T2 &&\fB__y\fP)" .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<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBpair\fP (_T1, _T2) \-> \fBpair\fP< _T1, _T2 >" .br .RI "Two pairs of the same type are equal iff their members are equal\&. " .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr bool \fBoperator==\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .RI "Two pairs of the same type are equal iff their members are equal\&. " .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr bool \fBoperator<\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr bool \fBoperator!=\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .RI "Uses \fCoperator==\fP to find the result\&. " .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr bool \fBoperator>\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .RI "Uses \fCoperator<\fP to find the result\&. " .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr bool \fBoperator<=\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .RI "Uses \fCoperator<\fP to find the result\&. " .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr bool \fBoperator>=\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .RI "Uses \fCoperator<\fP to find the result\&. " .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr \fBenable_if\fP< __and_< \fB__is_swappable\fP< _T1 >, \fB__is_swappable\fP< _T2 > >::value >::type \fBswap\fP (\fBpair\fP< _T1, _T2 > &__x, \fBpair\fP< _T1, _T2 > &\fB__y\fP) noexcept(noexcept(__x\&.swap(\fB__y\fP)))" .br .in -1c .in -1c .SH "Detailed Description" .PP .SS "template<\fBtypename\fP _T1, \fBtypename\fP _T2> .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 .SH "Member Typedef Documentation" .PP .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBtypedef\fP _T1 \fBstd::pair\fP< _T1, _T2 >::first_type" .PP The type of the \fCfirst\fP member\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBtypedef\fP _T2 \fBstd::pair\fP< _T1, _T2 >::second_type" .PP The type of the \fCsecond\fP member\&. .SH "Constructor & Destructor Documentation" .PP .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr \fBstd::pair\fP< _T1, _T2 >::pair (const \fBpair\fP< _T1, _T2 > &)\fC [constexpr]\fP, \fC [default]\fP" .PP Copy constructor\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr \fBstd::pair\fP< _T1, _T2 >::pair (\fBpair\fP< _T1, _T2 > &&)\fC [constexpr]\fP, \fC [default]\fP" .PP Move constructor\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > template<\fBtypename\fP \fB_U1\fP = _T1, \fBtypename\fP \fB_U2\fP = _T2, \fBtypename\fP \fBenable_if\fP< __and_< __is_implicitly_default_constructible< \fB_U1\fP >, __is_implicitly_default_constructible< \fB_U2\fP > > ::value, bool >::type = true> constexpr \fBstd::pair\fP< _T1, _T2 >::pair ()\fC [inline]\fP, \fC [constexpr]\fP" The default constructor creates \fCfirst\fP and \fCsecond\fP using their respective default constructors\&. .br .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > template<\fBtypename\fP \fB_U1\fP = _T1, \fBtypename\fP \fB_U2\fP = _T2, \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_ConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&_PCCP::template \fB_ImplicitlyConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = true> constexpr \fBstd::pair\fP< _T1, _T2 >::pair (const _T1 & __a, const _T2 & __b)\fC [inline]\fP, \fC [constexpr]\fP" .PP Construct from two const lvalues, allowing implicit conversions\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > template<\fBtypename\fP \fB_U1\fP = _T1, \fBtypename\fP \fB_U2\fP = _T2, \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_ConstructiblePair\fP< \fB_U1\fP, \fB_U2\fP >() &&!_PCCP::template \fB_ImplicitlyConvertiblePair\fP< \fB_U1\fP, \fB_U2\fP >(), bool >::type = false> constexpr \fBstd::pair\fP< _T1, _T2 >::pair (const _T1 & __a, const _T2 & __b)\fC [inline]\fP, \fC [explicit]\fP, \fC [constexpr]\fP" .PP Construct from two const lvalues, disallowing implicit conversions\&. .SH "Member Function Documentation" .PP .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > constexpr \fBvoid\fP \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 References \fBstd::pair< _T1, _T2 >::first\fP, \fBstd::pair< _T1, _T2 >::second\fP, \fBstd::swap()\fP, and \fBstd::pair< _T1, _T2 >::swap()\fP\&. .PP Referenced by \fBstd::pair< _T1, _T2 >::swap()\fP, and \fBstd::sub_match< _BiIter >::swap()\fP\&. .SH "Member Data Documentation" .PP .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > _T1 \fBstd::pair\fP< _T1, _T2 >::first" .PP The first member\&. .PP Referenced by \fBstd::pair< _T1, _T2 >::swap()\fP\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > _T2 \fBstd::pair\fP< _T1, _T2 >::second" .PP The second member\&. .PP Referenced by \fBstd::pair< _T1, _T2 >::swap()\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.