.TH "__gnu_cxx::pair< _T1, _T2 >" 3 "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME __gnu_cxx::pair< _T1, _T2 > \- Struct holding two objects (or references) of arbitrary type\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Types" .in +1c .ti -1c .RI "typedef _T1 \fBfirst_type\fP" .br .RI "The type of the \fRfirst\fP member\&. " .ti -1c .RI "typedef _T2 \fBsecond_type\fP" .br .RI "The type of the \fRsecond\fP member\&. " .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "constexpr \fBpair\fP (const pair &)=default" .br .RI "Copy constructor\&. " .ti -1c .RI "constexpr \fBpair\fP (pair &&)=default" .br .RI "Move constructor\&. " .ti -1c .RI "template constexpr \fBpair\fP (piecewise_construct_t, tuple< _Args1\&.\&.\&. >, tuple< _Args2\&.\&.\&. >)" .br .ti -1c .RI "template constexpr \fBexplicit\fP (!_S_convertible< _U1 &, _U2 & >()) \fBpair\fP(\fBpair\fP< _U1" .br .ti -1c .RI "template constexpr _U2 &&constexpr \fBexplicit\fP (!_S_convertible< _U1 &, _U2 & >()) \fBpair\fP(\fBpair\fP< _U1" .br .RI "Converting constructor from a non-const \fRpair\fP lvalue\&. " .ti -1c .RI "template constexpr \fBexplicit\fP (!_S_convertible< _U1, _U2 >()) \fBpair\fP(_U1 &&" .br .ti -1c .RI "template constexpr \fBexplicit\fP (!_S_convertible< _U1, _U2 >()) \fBpair\fP(_U1 &&__x" .br .RI "Constructor accepting two values of arbitrary types\&. " .ti -1c .RI "template constexpr \fBexplicit\fP (!_S_convertible< _U1, _U2 >()) \fBpair\fP(\fBpair\fP< _U1" .br .ti -1c .RI "template constexpr _U2 &constexpr \fBexplicit\fP (!_S_convertible< _U1, _U2 >()) \fBpair\fP(\fBpair\fP< _U1" .br .RI "Converting constructor from a non-const \fRpair\fP rvalue\&. " .ti -1c .RI "constexpr \fBexplicit\fP (!_S_convertible< const _T1 &, const _T2 & >()) \fBpair\fP(const type_identity_t< _T1 > &__x" .br .RI "Constructor accepting lvalues of \fRfirst_type\fP and \fRsecond_type\fP\&. " .ti -1c .RI "template constexpr \fBexplicit\fP (!_S_convertible< const _U1 &, const _U2 & >()) \fBpair\fP(const \fBpair\fP< _U1" .br .ti -1c .RI "template constexpr _U2 &&constexpr \fBexplicit\fP (!_S_convertible< const _U1 &, const _U2 & >()) \fBpair\fP(const \fBpair\fP< _U1" .br .RI "Converting constructor from a const \fRpair\fP lvalue\&. " .ti -1c .RI "template constexpr \fBexplicit\fP (!_S_convertible< const _U1, const _U2 >()) \fBpair\fP(const \fBpair\fP< _U1" .br .ti -1c .RI "template constexpr _U2 &constexpr \fBexplicit\fP (!_S_convertible< const _U1, const _U2 >()) \fBpair\fP(const \fBpair\fP< _U1" .br .RI "Converting constructor from a const \fRpair\fP rvalue\&. " .ti -1c .RI "template<__eligible_pair_like< \fBpair\fP > _UPair> constexpr \fBexplicit\fP (!_S_convertible_from_pair_like< _UPair >()) \fBpair\fP(_UPair &&)=delete" .br .ti -1c .RI "template<__eligible_pair_like< \fBpair\fP > _UPair> constexpr _U2 &&constexpr \fBexplicit\fP (!_S_convertible_from_pair_like< _UPair >()) \fBpair\fP(_UPair &&__p)" .br .ti -1c .RI "constexpr \fBexplicit\fP (__not_< __and_< __is_implicitly_default_constructible< _T1 >, __is_implicitly_default_constructible< _T2 > > >()) \fBpair\fP() noexcept(is_nothrow_default_constructible_v< _T1 > &&is_nothrow_default_constructible_v< _T2 >)" .br .RI "Default constructor\&. " .ti -1c .RI "constexpr _U2 &&constexpr _U2 &__p \fBnoexcept\fP (_S_nothrow_constructible< _U1 &, _U2 & >())" .br .ti -1c .RI "constexpr _U2 &constexpr _U2 &&__p \fBnoexcept\fP (_S_nothrow_constructible< _U1, _U2 >())" .br .ti -1c .RI "constexpr _U2 &&__y \fBnoexcept\fP (_S_nothrow_constructible< _U1, _U2 >())" .br .ti -1c .RI "constexpr const _T2 &__y \fBnoexcept\fP (_S_nothrow_constructible< const _T1 &, const _T2 & >())" .br .ti -1c .RI "constexpr _U2 &&constexpr _U2 &__p \fBnoexcept\fP (_S_nothrow_constructible< const _U1 &, const _U2 & >())" .br .ti -1c .RI "constexpr _U2 &constexpr _U2 &&__p \fBnoexcept\fP (_S_nothrow_constructible< const _U1, const _U2 >())" .br .ti -1c .RI "template<__eligible_pair_like< \fBpair\fP > _UPair> constexpr \fBpair\fP & \fBoperator=\fP (_UPair &&__p)" .br .ti -1c .RI "template<__eligible_pair_like< \fBpair\fP > _UPair> constexpr const \fBpair\fP & \fBoperator=\fP (_UPair &&__p) const" .br .ti -1c .RI "\fBpair\fP & \fBoperator=\fP (const \fBpair\fP &)=delete" .br .ti -1c .RI "constexpr const \fBpair\fP & \fBoperator=\fP (const \fBpair\fP &__p) const" .br .RI "Copy assignment operator (const)\&. " .ti -1c .RI "constexpr \fBpair\fP & \fBoperator=\fP (const \fBpair\fP &__p) noexcept(_S_nothrow_assignable< const _T1 &, const _T2 & >())" .br .RI "Copy assignment operator\&. " .ti -1c .RI "template .br requires (_S_const_assignable())constexpr const \fBpair\fP & \fBoperator=\fP (const \fBpair\fP< _U1, _U2 > &__p) const" .br .RI "Converting assignment from a const \fRpair\fP lvalue\&. " .ti -1c .RI "template .br requires (_S_assignable())constexpr \fBpair\fP & \fBoperator=\fP (const \fBpair\fP< _U1, _U2 > &__p) noexcept(_S_nothrow_assignable< const _U1 &, const _U2 & >())" .br .RI "Converting assignment from a const \fRpair\fP lvalue\&. " .ti -1c .RI "constexpr const \fBpair\fP & \fBoperator=\fP (\fBpair\fP &&__p) const" .br .RI "Move assignment operator (const)\&. " .ti -1c .RI "constexpr \fBpair\fP & \fBoperator=\fP (\fBpair\fP &&__p) noexcept(_S_nothrow_assignable< _T1, _T2 >())" .br .RI "Move assignment operator\&. " .ti -1c .RI "template .br requires (_S_const_assignable<_U1, _U2>())constexpr const \fBpair\fP & \fBoperator=\fP (\fBpair\fP< _U1, _U2 > &&__p) const" .br .RI "Converting assignment from a non-const \fRpair\fP rvalue\&. " .ti -1c .RI "template .br requires (_S_assignable<_U1, _U2>())constexpr \fBpair\fP & \fBoperator=\fP (\fBpair\fP< _U1, _U2 > &&__p) noexcept(_S_nothrow_assignable< _U1, _U2 >())" .br .RI "Converting assignment from a non-const \fRpair\fP rvalue\&. " .ti -1c .RI "constexpr void \fBswap\fP (const \fBpair\fP &__p) const noexcept(__and_v< __is_nothrow_swappable< const _T1 >, __is_nothrow_swappable< const _T2 > >)" .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 Symbols" (Note that these are not member symbols\&.) .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "template \fBpair\fP (_T1, _T2) \-> pair< _T1, _T2 >" .br .ti -1c .RI "template constexpr enable_if< __and_< __is_swappable< _T1 >, __is_swappable< _T2 > >::value >\fB::type\fP \fBswap\fP (\fBpair\fP< _T1, _T2 > &__x, \fBpair\fP< _T1, _T2 > &__y) noexcept(noexcept(__x\&.swap(__y)))" .br .ti -1c .RI "template constexpr bool \fBoperator==\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _U1, _U2 > &__y)" .br .RI "Two pairs are equal iff their members are equal\&. " .ti -1c .RI "template constexpr common_comparison_category_t< __detail::__synth3way_t< _T1, _U1 >, __detail::__synth3way_t< _T2, _U2 > > \fBoperator<=>\fP (const \fBpair\fP< _T1, _T2 > &__x, const \fBpair\fP< _U1, _U2 > &__y)" .br .in -1c .in -1c .SH "Detailed Description" .PP .SS "template .br struct __gnu_cxx::pair< _T1, _T2 >"Struct holding two objects (or references) of arbitrary type\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_T1\fP Type of the \fRfirst\fP member\&. .br \fI_T2\fP Type of the \fRsecond\fP member\&. .RE .PP https://gcc.gnu.org/onlinedocs/libstdc++/manual/utilities.html .SH "Member Typedef Documentation" .PP .SS "template typedef _T1 \fBstd::pair\fP< _T1, _T2 >::first_type" .PP The type of the \fRfirst\fP member\&. .SS "template typedef _T2 \fBstd::pair\fP< _T1, _T2 >::second_type" .PP The type of the \fRsecond\fP member\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::pair\fP< _T1, _T2 >::pair (const pair< _T1, _T2 > & )\fR [constexpr]\fP, \fR [default]\fP" .PP Copy constructor\&. .SS "template \fBstd::pair\fP< _T1, _T2 >::pair (pair< _T1, _T2 > && )\fR [constexpr]\fP, \fR [default]\fP" .PP Move constructor\&. .SH "Member Function Documentation" .PP .SS "template template _U2 &&constexpr \fBstd::pair\fP< _T1, _T2 >::explicit (!_S_convertible< _U1 &, _U2 & > ())\fR [constexpr]\fP" .PP Converting constructor from a non-const \fRpair\fP lvalue\&. .SS "template template \fBstd::pair\fP< _T1, _T2 >::explicit (!_S_convertible< _U1, _U2 > ()) &&\fR [constexpr]\fP" .PP Constructor accepting two values of arbitrary types\&. .SS "template template _U2 &constexpr \fBstd::pair\fP< _T1, _T2 >::explicit (!_S_convertible< _U1, _U2 > ())\fR [constexpr]\fP" .PP Converting constructor from a non-const \fRpair\fP rvalue\&. .SS "template \fBstd::pair\fP< _T1, _T2 >::explicit (!_S_convertible< const _T1 &, const _T2 & > ()) const &\fR [constexpr]\fP" .PP Constructor accepting lvalues of \fRfirst_type\fP and \fRsecond_type\fP\&. .SS "template template _U2 &&constexpr \fBstd::pair\fP< _T1, _T2 >::explicit (!_S_convertible< const _U1 &, const _U2 & > ()) const\fR [constexpr]\fP" .PP Converting constructor from a const \fRpair\fP lvalue\&. .SS "template template _U2 &constexpr \fBstd::pair\fP< _T1, _T2 >::explicit (!_S_convertible< const _U1, const _U2 > ()) const\fR [constexpr]\fP" .PP Converting constructor from a const \fRpair\fP rvalue\&. .SS "template \fBstd::pair\fP< _T1, _T2 >::explicit (__not_< __and_< __is_implicitly_default_constructible< _T1 >, __is_implicitly_default_constructible< _T2 > > > ())\fR [inline]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Default constructor\&. .SS "template const \fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (const \fBpair\fP< _T1, _T2 > & __p) const\fR [inline]\fP, \fR [constexpr]\fP" .PP Copy assignment operator (const)\&. .SS "template \fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (const \fBpair\fP< _T1, _T2 > & __p)\fR [inline]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Copy assignment operator\&. .SS "template template .br requires (_S_const_assignable())const \fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (const \fBpair\fP< _U1, _U2 > & __p) const\fR [inline]\fP, \fR [constexpr]\fP" .PP Converting assignment from a const \fRpair\fP lvalue\&. .SS "template template .br requires (_S_assignable())\fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (const \fBpair\fP< _U1, _U2 > & __p)\fR [inline]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Converting assignment from a const \fRpair\fP lvalue\&. .SS "template const \fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (\fBpair\fP< _T1, _T2 > && __p) const\fR [inline]\fP, \fR [constexpr]\fP" .PP Move assignment operator (const)\&. .SS "template \fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (\fBpair\fP< _T1, _T2 > && __p)\fR [inline]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Move assignment operator\&. .SS "template template .br requires (_S_const_assignable<_U1, _U2>())const \fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (\fBpair\fP< _U1, _U2 > && __p) const\fR [inline]\fP, \fR [constexpr]\fP" .PP Converting assignment from a non-const \fRpair\fP rvalue\&. .SS "template template .br requires (_S_assignable<_U1, _U2>())\fBpair\fP & \fBstd::pair\fP< _T1, _T2 >::operator= (\fBpair\fP< _U1, _U2 > && __p)\fR [inline]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Converting assignment from a non-const \fRpair\fP rvalue\&. .SS "template void \fBstd::pair\fP< _T1, _T2 >::swap (\fBpair\fP< _T1, _T2 > & __p)\fR [inline]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Swap the first members and then the second members\&. .SH "Member Data Documentation" .PP .SS "template _T1 \fBstd::pair\fP< _T1, _T2 >::first" .PP The first member\&. .SS "template _T2 \fBstd::pair\fP< _T1, _T2 >::second" .PP The second member\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.