libstdc++: std::tuple< _T1, _T2 > Class Template Reference

libstdc++

std::tuple< _T1, _T2 > Class Template Reference
Utilities

`#include <tuple>`

## Public Member Functions
template<typename _U1, typename _U2, _ImplicitCtor<!__is_alloc_arg< _U1 >(), _U1, _U2 > = true>
constexpr | tuple (_U1 &&__a1, _U2 &&__a2) noexcept(__nothrow_constructible< _U1, _U2 >())
template<typename _U1, typename _U2, _ExplicitCtor<!__is_alloc_arg< _U1 >(), _U1, _U2 > = false>
constexpr | tuple (_U1 &&__a1, _U2 &&__a2) noexcept(__nothrow_constructible< _U1, _U2 >())
template<typename _Alloc, _ImplicitDefaultCtor< is_object< _Alloc >::value, _T1, _T2 > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a)
template<typename _Alloc, _ExplicitDefaultCtor< is_object< _Alloc >::value, _T1, _T2 > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a)
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, _U1 &&__a1, _U2 &&__a2)
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, _U1 &&__a1, _U2 &&__a2)
template<typename _Alloc, bool _Dummy = true, _ImplicitCtor< _Dummy, const _T1 &, const _T2 & > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const _T1 &__a1, const _T2 &__a2)
template<typename _Alloc, bool _Dummy = true, _ExplicitCtor< _Dummy, const _T1 &, const _T2 & > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const _T1 &__a1, const _T2 &__a2)
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const pair< _U1, _U2 > &__in)
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const pair< _U1, _U2 > &__in)
template<typename _Alloc>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const tuple &__in)
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const tuple< _U1, _U2 > &__in)
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, const tuple< _U1, _U2 > &__in)
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, pair< _U1, _U2 > &&__in)
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, pair< _U1, _U2 > &&__in)
template<typename _Alloc>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, tuple &&__in)
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, tuple< _U1, _U2 > &&__in)
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>
constexpr | tuple (allocator_arg_t __tag, const _Alloc &__a, tuple< _U1, _U2 > &&__in)
template<bool _Dummy = true, _ImplicitCtor< _Dummy, const _T1 &, const _T2 & > = true>
constexpr | tuple (const _T1 &__a1, const _T2 &__a2) noexcept(__nothrow_constructible< const _T1 &, const _T2 & >())
template<bool _Dummy = true, _ExplicitCtor< _Dummy, const _T1 &, const _T2 & > = false>
constexpr | tuple (const _T1 &__a1, const _T2 &__a2) noexcept(__nothrow_constructible< const _T1 &, const _T2 & >())
template<typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>
constexpr | tuple (const pair< _U1, _U2 > &__in) noexcept(__nothrow_constructible< const _U1 &, const _U2 & >())
template<typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>
constexpr | tuple (const pair< _U1, _U2 > &__in) noexcept(__nothrow_constructible< const _U1 &, const _U2 & >())
constexpr | tuple (const tuple &)=default
template<typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>
constexpr | tuple (const tuple< _U1, _U2 > &__in) noexcept(__nothrow_constructible< const _U1 &, const _U2 & >())
template<typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>
constexpr | tuple (const tuple< _U1, _U2 > &__in) noexcept(__nothrow_constructible< const _U1 &, const _U2 & >())
template<typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>
constexpr | tuple (pair< _U1, _U2 > &&__in) noexcept(__nothrow_constructible< _U1, _U2 >())
template<typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>
constexpr | tuple (pair< _U1, _U2 > &&__in) noexcept(__nothrow_constructible< _U1, _U2 >())
constexpr | tuple (tuple &&)=default
template<typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>
constexpr | tuple (tuple< _U1, _U2 > &&__in) noexcept(__nothrow_constructible< _U1, _U2 >())
template<typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>
constexpr | tuple (tuple< _U1, _U2 > &&__in) noexcept(__nothrow_constructible< _U1, _U2 >())
constexpr tuple & | operator= (__conditional_t< __assignable< _T1, _T2 >(), tuple &&, __nonesuch && > __in) noexcept(__nothrow_assignable< _T1, _T2 >())
constexpr tuple & | operator= (__conditional_t< __assignable< const _T1 &, const _T2 & >(), const tuple &, const __nonesuch & > __in) noexcept(__nothrow_assignable< const _T1 &, const _T2 & >())
template<typename _U1, typename _U2>
constexpr __enable_if_t< __assignable< const _U1 &, const _U2 & >(), tuple & > | operator= (const pair< _U1, _U2 > &__in) noexcept(__nothrow_assignable< const _U1 &, const _U2 & >())
template<typename _U1, typename _U2>
constexpr __enable_if_t< __assignable< const _U1 &, const _U2 & >(), tuple & > | operator= (const tuple< _U1, _U2 > &__in) noexcept(__nothrow_assignable< const _U1 &, const _U2 & >())
template<typename _U1, typename _U2>
constexpr __enable_if_t< __assignable< _U1, _U2 >(), tuple & > | operator= (pair< _U1, _U2 > &&__in) noexcept(__nothrow_assignable< _U1, _U2 >())
template<typename _U1, typename _U2>
constexpr __enable_if_t< __assignable< _U1, _U2 >(), tuple & > | operator= (tuple< _U1, _U2 > &&__in) noexcept(__nothrow_assignable< _U1, _U2 >())
constexpr void | swap (tuple &__in) noexcept(__and_< __is_nothrow_swappable< _T1 >, __is_nothrow_swappable< _T2 > >::value)

## Detailed Description

template<typename _T1, typename _T2>
class std::tuple< _T1, _T2 >

Partial specialization, 2-element tuple. Includes construction and assignment from a pair.

Definition at line 2063 of file tuple.

## Constructor & Destructor Documentation

## ◆ tuple() [1/30]

template<typename _T1, typename _T2>
template<bool _Dummy = true, _ImplicitDefaultCtor< _Dummy, _T1, _T2 > = true>

std::tuple< _T1, _T2 >::tuple | ( |  | ) |
| inlineconstexprnoexcept

Definition at line 2145 of file tuple.

## ◆ tuple() [2/30]

template<typename _T1, typename _T2>
template<bool _Dummy = true, _ExplicitDefaultCtor< _Dummy, _T1, _T2 > = false>

std::tuple< _T1, _T2 >::tuple | ( |  | ) |
| inlineexplicitconstexprnoexcept

Definition at line 2152 of file tuple.

## ◆ tuple() [3/30]

template<typename _T1, typename _T2>
template<bool _Dummy = true, _ImplicitCtor< _Dummy, const _T1 &, const _T2 & > = true>

std::tuple< _T1, _T2 >::tuple | ( | const _T1 & | __a1,
|  | const _T2 & | __a2 )
| inlineconstexprnoexcept

Definition at line 2159 of file tuple.

## ◆ tuple() [4/30]

template<typename _T1, typename _T2>
template<bool _Dummy = true, _ExplicitCtor< _Dummy, const _T1 &, const _T2 & > = false>

std::tuple< _T1, _T2 >::tuple | ( | const _T1 & | __a1,
|  | const _T2 & | __a2 )
| inlineexplicitconstexprnoexcept

Definition at line 2166 of file tuple.

## ◆ tuple() [5/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ImplicitCtor<!__is_alloc_arg< _U1 >(), _U1, _U2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | _U1 && | __a1,
|  | _U2 && | __a2 )
| inlineconstexprnoexcept

Definition at line 2173 of file tuple.

## ◆ tuple() [6/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ExplicitCtor<!__is_alloc_arg< _U1 >(), _U1, _U2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | _U1 && | __a1,
|  | _U2 && | __a2 )
| inlineexplicitconstexprnoexcept

Definition at line 2181 of file tuple.

## ◆ tuple() [7/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>

std::tuple< _T1, _T2 >::tuple | ( | const tuple< _U1, _U2 > & | __in | ) |
| inlineconstexprnoexcept

Definition at line 2193 of file tuple.

## ◆ tuple() [8/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>

std::tuple< _T1, _T2 >::tuple | ( | const tuple< _U1, _U2 > & | __in | ) |
| inlineexplicitconstexprnoexcept

Definition at line 2201 of file tuple.

## ◆ tuple() [9/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | tuple< _U1, _U2 > && | __in | ) |
| inlineconstexprnoexcept

Definition at line 2209 of file tuple.

## ◆ tuple() [10/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | tuple< _U1, _U2 > && | __in | ) |
| inlineexplicitconstexprnoexcept

Definition at line 2217 of file tuple.

## ◆ tuple() [11/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>

std::tuple< _T1, _T2 >::tuple | ( | const pair< _U1, _U2 > & | __in | ) |
| inlineconstexprnoexcept

Definition at line 2225 of file tuple.

## ◆ tuple() [12/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>

std::tuple< _T1, _T2 >::tuple | ( | const pair< _U1, _U2 > & | __in | ) |
| inlineexplicitconstexprnoexcept

Definition at line 2233 of file tuple.

## ◆ tuple() [13/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | pair< _U1, _U2 > && | __in | ) |
| inlineconstexprnoexcept

Definition at line 2241 of file tuple.

## ◆ tuple() [14/30]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | pair< _U1, _U2 > && | __in | ) |
| inlineexplicitconstexprnoexcept

Definition at line 2250 of file tuple.

## ◆ tuple() [15/30]

template<typename _T1, typename _T2>
template<typename _Alloc, _ImplicitDefaultCtor< is_object< _Alloc >::value, _T1, _T2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a )
| inlineconstexpr

Definition at line 2261 of file tuple.

## ◆ tuple() [16/30]

template<typename _T1, typename _T2>
template<typename _Alloc, _ExplicitDefaultCtor< is_object< _Alloc >::value, _T1, _T2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a )
| inlineexplicitconstexpr

Definition at line 2268 of file tuple.

## ◆ tuple() [17/30]

template<typename _T1, typename _T2>
template<typename _Alloc, bool _Dummy = true, _ImplicitCtor< _Dummy, const _T1 &, const _T2 & > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const _T1 & | __a1,
|  | const _T2 & | __a2 )
| inlineconstexpr

Definition at line 2274 of file tuple.

## ◆ tuple() [18/30]

template<typename _T1, typename _T2>
template<typename _Alloc, bool _Dummy = true, _ExplicitCtor< _Dummy, const _T1 &, const _T2 & > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const _T1 & | __a1,
|  | const _T2 & | __a2 )
| inlineexplicitconstexpr

Definition at line 2282 of file tuple.

## ◆ tuple() [19/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | _U1 && | __a1,
|  | _U2 && | __a2 )
| inlineconstexpr

Definition at line 2289 of file tuple.

## ◆ tuple() [20/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | _U1 && | __a1,
|  | _U2 && | __a2 )
| inlineexplicitconstexpr

Definition at line 2298 of file tuple.

## ◆ tuple() [21/30]

template<typename _T1, typename _T2>
template<typename _Alloc>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const tuple< _T1, _T2 > & | __in )
| inlineconstexpr

Definition at line 2306 of file tuple.

## ◆ tuple() [22/30]

template<typename _T1, typename _T2>
template<typename _Alloc>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | tuple< _T1, _T2 > && | __in )
| inlineconstexpr

Definition at line 2311 of file tuple.

## ◆ tuple() [23/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const tuple< _U1, _U2 > & | __in )
| inlineconstexpr

Definition at line 2317 of file tuple.

## ◆ tuple() [24/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const tuple< _U1, _U2 > & | __in )
| inlineexplicitconstexpr

Definition at line 2327 of file tuple.

## ◆ tuple() [25/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | tuple< _U1, _U2 > && | __in )
| inlineconstexpr

Definition at line 2336 of file tuple.

## ◆ tuple() [26/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | tuple< _U1, _U2 > && | __in )
| inlineexplicitconstexpr

Definition at line 2344 of file tuple.

## ◆ tuple() [27/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, const _U1 &, const _U2 & > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const pair< _U1, _U2 > & | __in )
| inlineconstexpr

Definition at line 2351 of file tuple.

## ◆ tuple() [28/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, const _U1 &, const _U2 & > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | const pair< _U1, _U2 > & | __in )
| inlineexplicitconstexpr

Definition at line 2360 of file tuple.

## ◆ tuple() [29/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ImplicitCtor< true, _U1, _U2 > = true>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | pair< _U1, _U2 > && | __in )
| inlineconstexpr

Definition at line 2368 of file tuple.

## ◆ tuple() [30/30]

template<typename _T1, typename _T2>
template<typename _Alloc, typename _U1, typename _U2, _ExplicitCtor< true, _U1, _U2 > = false>

std::tuple< _T1, _T2 >::tuple | ( | allocator_arg_t | __tag,
|  | const _Alloc & | __a,
|  | pair< _U1, _U2 > && | __in )
| inlineexplicitconstexpr

Definition at line 2377 of file tuple.

## Member Function Documentation

## ◆ operator=() [1/6]

template<typename _T1, typename _T2>

tuple & std::tuple< _T1, _T2 >::operator= | ( | __conditional_t< __assignable< _T1, _T2 >(), tuple< _T1, _T2 > &&, __nonesuch && > | __in | ) |
| inlineconstexprnoexcept

Definition at line 2397 of file tuple.

## ◆ operator=() [2/6]

template<typename _T1, typename _T2>

tuple & std::tuple< _T1, _T2 >::operator= | ( | __conditional_t< __assignable< const _T1 &, const _T2 & >(), const tuple< _T1, _T2 > &, const __nonesuch & > | __in | ) |
| inlineconstexprnoexcept

Definition at line 2386 of file tuple.

## ◆ operator=() [3/6]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2>

__enable_if_t< __assignable< const _U1 &, const _U2 & >(), tuple & > std::tuple< _T1, _T2 >::operator= | ( | const pair< _U1, _U2 > & | __in | ) |
| inlineconstexprnoexcept

Definition at line 2429 of file tuple.

## ◆ operator=() [4/6]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2>

__enable_if_t< __assignable< const _U1 &, const _U2 & >(), tuple & > std::tuple< _T1, _T2 >::operator= | ( | const tuple< _U1, _U2 > & | __in | ) |
| inlineconstexprnoexcept

Definition at line 2409 of file tuple.

## ◆ operator=() [5/6]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2>

__enable_if_t< __assignable< _U1, _U2 >(), tuple & > std::tuple< _T1, _T2 >::operator= | ( | pair< _U1, _U2 > && | __in | ) |
| inlineconstexprnoexcept

Definition at line 2440 of file tuple.

## ◆ operator=() [6/6]

template<typename _T1, typename _T2>
template<typename _U1, typename _U2>

__enable_if_t< __assignable< _U1, _U2 >(), tuple & > std::tuple< _T1, _T2 >::operator= | ( | tuple< _U1, _U2 > && | __in | ) |
| inlineconstexprnoexcept

Definition at line 2419 of file tuple.

## ◆ swap()

template<typename _T1, typename _T2>

void std::tuple< _T1, _T2 >::swap | ( | tuple< _T1, _T2 > & | __in | ) |
| inlineconstexprnoexcept

Definition at line 2450 of file tuple.

The documentation for this class was generated from the following file:

- tuple