.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 >\&. .PP Inherited by \fBstd::sub_match< _Bi_iter >\fP\&. .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> \fBconstexpr\fP \fBpair\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> \fBconstexpr\fP \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> \fBconstexpr\fP \fBpair\fP (\fB_U1\fP &&__x, \fB_U2\fP &&\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_MoveCopyPair\fP< \fBtrue\fP, \fB_U1\fP, _T2 >(), bool >::type = true> \fBconstexpr\fP \fBpair\fP (\fB_U1\fP &&__x, \fBconst\fP _T2 &\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_MoveCopyPair\fP< \fBfalse\fP, \fB_U1\fP, _T2 >(), bool >::type = false> \fBconstexpr\fP \fBpair\fP (\fB_U1\fP &&__x, \fBconst\fP _T2 &\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> \fBconstexpr\fP \fBpair\fP (\fBconst\fP _T1 &__a, \fBconst\fP _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> \fBconstexpr\fP \fBpair\fP (\fBconst\fP _T1 &__a, \fBconst\fP _T2 &__b)" .br .RI "Construct from two const lvalues, disallowing implicit conversions\&. " .ti -1c .RI "template<\fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_CopyMovePair\fP< \fBtrue\fP, _T1, \fB_U2\fP >(), bool >::type = true> \fBconstexpr\fP \fBpair\fP (\fBconst\fP _T1 &__x, \fB_U2\fP &&\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U2\fP , \fBtypename\fP \fBenable_if\fP< _PCCP::template \fB_CopyMovePair\fP< \fBfalse\fP, _T1, \fB_U2\fP >(), bool >::type = false> \fBpair\fP (\fBconst\fP _T1 &__x, \fB_U2\fP &&\fB__y\fP)" .br .ti -1c .RI "\fBconstexpr\fP \fBpair\fP (\fBconst\fP \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> \fBconstexpr\fP \fBpair\fP (\fBconst\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_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> \fBconstexpr\fP \fBpair\fP (\fBconst\fP \fBpair\fP< \fB_U1\fP, \fB_U2\fP > &__p)" .br .ti -1c .RI "\fBconstexpr\fP \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> \fBconstexpr\fP \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> \fBconstexpr\fP \fBpair\fP (\fBpair\fP< \fB_U1\fP, \fB_U2\fP > &&__p)" .br .ti -1c .RI "template \fBconstexpr\fP \fBpair\fP (\fBpiecewise_construct_t\fP, \fBtuple\fP< _Args1\&.\&.\&. >, \fBtuple\fP< _Args2\&.\&.\&. >)" .br .ti -1c .RI "template<\fBtypename\fP \fB_U1\fP , \fBtypename\fP \fB_U2\fP > \fBconstexpr\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 (\fBconst\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 > \fBconstexpr\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 "\fBconstexpr\fP \fBpair\fP & \fBoperator=\fP (\fBtypename\fP \fBconditional\fP< __and_< \fBis_copy_assignable\fP< _T1 >, \fBis_copy_assignable\fP< _T2 > >::value, \fBconst\fP \fBpair\fP &, \fBconst\fP \fB__nonesuch\fP & >::type __p)" .br .ti -1c .RI "\fBconstexpr\fP \fBpair\fP & \fBoperator=\fP (\fBtypename\fP \fBconditional\fP< __and_< \fBis_move_assignable\fP< _T1 >, \fBis_move_assignable\fP< _T2 > >::value, \fBpair\fP &&, \fB__nonesuch\fP && >::type __p) \fBnoexcept\fP(__and_< \fBis_nothrow_move_assignable\fP< _T1 >, \fBis_nothrow_move_assignable\fP< _T2 > >::value)" .br .ti -1c .RI "\fBconstexpr\fP \fBvoid\fP \fBswap\fP (\fBpair\fP &__p) \fBnoexcept\fP(__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 > \fBconstexpr\fP \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 > \fBconstexpr\fP bool \fBoperator==\fP (\fBconst\fP \fBpair\fP< _T1, _T2 > &__x, \fBconst\fP \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBconstexpr\fP bool \fBoperator<\fP (\fBconst\fP \fBpair\fP< _T1, _T2 > &__x, \fBconst\fP \fBpair\fP< _T1, _T2 > &\fB__y\fP)" .br .ti -1c .RI "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBconstexpr\fP bool \fBoperator!=\fP (\fBconst\fP \fBpair\fP< _T1, _T2 > &__x, \fBconst\fP \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 > \fBconstexpr\fP bool \fBoperator>\fP (\fBconst\fP \fBpair\fP< _T1, _T2 > &__x, \fBconst\fP \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 > \fBconstexpr\fP bool \fBoperator<=\fP (\fBconst\fP \fBpair\fP< _T1, _T2 > &__x, \fBconst\fP \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 > \fBconstexpr\fP bool \fBoperator>=\fP (\fBconst\fP \fBpair\fP< _T1, _T2 > &__x, \fBconst\fP \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 > \fBconstexpr\fP \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) \fBnoexcept\fP(\fBnoexcept\fP(__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 > 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> \fBconstexpr\fP \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> \fBconstexpr\fP \fBstd::pair\fP< _T1, _T2 >::pair (\fBconst\fP _T1 & __a, \fBconst\fP _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> \fBconstexpr\fP \fBstd::pair\fP< _T1, _T2 >::pair (\fBconst\fP _T1 & __a, \fBconst\fP _T2 & __b)\fC [inline]\fP, \fC [explicit]\fP, \fC [constexpr]\fP" .PP Construct from two const lvalues, disallowing implicit conversions\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBconstexpr\fP \fBstd::pair\fP< _T1, _T2 >::pair (\fBconst\fP \fBpair\fP< _T1, _T2 > &)\fC [constexpr]\fP, \fC [default]\fP" .PP Copy constructor\&. .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBconstexpr\fP \fBstd::pair\fP< _T1, _T2 >::pair (\fBpair\fP< _T1, _T2 > &&)\fC [constexpr]\fP, \fC [default]\fP" .PP Move constructor\&. .SH "Member Function Documentation" .PP .SS "template<\fBtypename\fP _T1 , \fBtypename\fP _T2 > \fBconstexpr\fP \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\&. .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\&.