STD::TUPLE(3cxx)

okay bestie, welcome to std::tuple< _Elements > from the cxx manual β€” yes, the whole page is about one iconic template and its absolutely enormous roster of member functions. buckle up, we're going through every single one πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

std::tuple< _Elements > β€” primary class template, tuple. that's it, that's the name, and honestly it ate.

✨ SYNOPSIS ✨

include this, bestie:

#include <tuple>

Inherits std::_Tuple_impl< 0, _Elements... >. no cap, that's the inheritance line.

πŸ’… Public Member Functions πŸ’…

okay so this is the part where the page goes absolutely feral with constructors and operators. here is every public member function in the exact order the manual lists them β€” no skips, no merges, no edits, periodt:

       template<typename... _UElements, bool _Valid =
           __valid_args<_UElements...>(), _ImplicitCtor< _Valid, _UElements...
           >  = true> constexpr tuple (_UElements &&... __elements)
           noexcept(__nothrow_constructible< _UElements... >())
       template<typename... _UElements, bool _Valid =
           __valid_args<_UElements...>(), _ExplicitCtor< _Valid, _UElements...
           >  = false> constexpr tuple (_UElements &&... __elements)
           noexcept(__nothrow_constructible< _UElements... >())
       template<typename _Alloc , _ImplicitDefaultCtor< is_object< _Alloc
           >::value >  = true> constexpr tuple (allocator_arg_t __tag, const
           _Alloc &__a)
       template<typename _Alloc , _ExplicitDefaultCtor< is_object< _Alloc
           >::value >  = false> constexpr tuple (allocator_arg_t __tag, const
           _Alloc &__a)
       template<typename _Alloc , typename... _UElements, bool _Valid =
           __valid_args<_UElements...>(), _ImplicitCtor< _Valid, _UElements...
           >  = true> constexpr tuple (allocator_arg_t __tag, const _Alloc
           &__a, _UElements &&... __elements)
       template<typename _Alloc , typename... _UElements, bool _Valid =
           __valid_args<_UElements...>(), _ExplicitCtor< _Valid, _UElements...
           >  = false> constexpr tuple (allocator_arg_t __tag, const _Alloc
           &__a, _UElements &&... __elements)
       template<typename _Alloc , bool _NotEmpty = (sizeof...(_Elements) >= 1),
           _ImplicitCtor< _NotEmpty, const _Elements &... >  = true> constexpr
           tuple (allocator_arg_t __tag, const _Alloc &__a, const _Elements
           &... __elements)
       template<typename _Alloc , bool _NotEmpty = (sizeof...(_Elements) >= 1),
           _ExplicitCtor< _NotEmpty, const _Elements &... >  = false> constexpr
           tuple (allocator_arg_t __tag, const _Alloc &__a, const _Elements
           &... __elements)
       template<typename _Alloc > constexpr tuple (allocator_arg_t __tag, const
           _Alloc &__a, const tuple &__in)
       template<typename _Alloc , typename... _UElements, bool _Valid =
           (sizeof...(_Elements) == sizeof...(_UElements)) &&
           !__use_other_ctor<const tuple<_UElements...>&>(), _ImplicitCtor<
           _Valid, const _UElements &... >  = true> constexpr tuple
           (allocator_arg_t __tag, const _Alloc &__a, const tuple<
           _UElements... > &__in)
       template<typename _Alloc , typename... _UElements, bool _Valid =
           (sizeof...(_Elements) == sizeof...(_UElements)) &&
           !__use_other_ctor<const tuple<_UElements...>&>(), _ExplicitCtor<
           _Valid, const _UElements &... >  = false> constexpr tuple
           (allocator_arg_t __tag, const _Alloc &__a, const tuple<
           _UElements... > &__in)
       template<typename _Alloc > constexpr tuple (allocator_arg_t __tag, const
           _Alloc &__a, tuple &&__in)
       template<typename _Alloc , typename... _UElements, bool _Valid =
           (sizeof...(_Elements) == sizeof...(_UElements)) &&
           !__use_other_ctor<tuple<_UElements...>&&>(), _ImplicitCtor< _Valid,
           _UElements... >  = true> constexpr tuple (allocator_arg_t __tag,
           const _Alloc &__a, tuple< _UElements... > &&__in)
       template<typename _Alloc , typename... _UElements, bool _Valid =
           (sizeof...(_Elements) == sizeof...(_UElements)) &&
           !__use_other_ctor<tuple<_UElements...>&&>(), _ExplicitCtor< _Valid,
           _UElements... >  = false> constexpr tuple (allocator_arg_t __tag,
           const _Alloc &__a, tuple< _UElements... > &&__in)
       template<bool _NotEmpty = (sizeof...(_Elements) >= 1), _ImplicitCtor<
           _NotEmpty, const _Elements &... >  = true> constexpr tuple (const
           _Elements &... __elements) noexcept(__nothrow_constructible< const
           _Elements &... >())
       template<bool _NotEmpty = (sizeof...(_Elements) >= 1), _ExplicitCtor<
           _NotEmpty, const _Elements &... >  = false> constexpr tuple (const
           _Elements &... __elements) noexcept(__nothrow_constructible< const
           _Elements &... >())
       constexpr tuple (const tuple &)=default
       template<typename... _UElements, bool _Valid = (sizeof...(_Elements) ==
           sizeof...(_UElements)) && !__use_other_ctor<const
           tuple<_UElements...>&>(), _ImplicitCtor< _Valid, const _UElements
           &... >  = true> constexpr tuple (const tuple< _UElements... > &__in)
           noexcept(__nothrow_constructible< const _UElements &... >())
       template<typename... _UElements, bool _Valid = (sizeof...(_Elements) ==
           sizeof...(_UElements)) && !__use_other_ctor<const
           tuple<_UElements...>&>(), _ExplicitCtor< _Valid, const _UElements
           &... >  = false> constexpr tuple (const tuple< _UElements... >
           &__in) noexcept(__nothrow_constructible< const _UElements &... >())
       constexpr tuple (tuple &&)=default
       template<typename... _UElements, bool _Valid = (sizeof...(_Elements) ==
           sizeof...(_UElements)) &&
           !__use_other_ctor<tuple<_UElements...>&&>(), _ImplicitCtor< _Valid,
           _UElements... >  = true> constexpr tuple (tuple< _UElements... >
           &&__in) noexcept(__nothrow_constructible< _UElements... >())
       template<typename... _UElements, bool _Valid = (sizeof...(_Elements) ==
           sizeof...(_UElements)) &&
           !__use_other_ctor<tuple<_UElements...>&&>(), _ExplicitCtor< _Valid,
           _UElements... >  = false> constexpr tuple (tuple< _UElements... >
           &&__in) noexcept(__nothrow_constructible< _UElements... >())
       constexpr tuple & operator= (__conditional_t< __assignable< _Elements...
           >(), tuple &&, __nonesuch && > __in) noexcept(__nothrow_assignable<
           _Elements... >())
       constexpr tuple & operator= (__conditional_t< __assignable< const
           _Elements &... >(), const tuple &, const __nonesuch & > __in)
           noexcept(__nothrow_assignable< const _Elements &... >())
       template<typename... _UElements> constexpr __enable_if_t< __assignable<
           const _UElements &... >(), tuple & > operator= (const tuple<
           _UElements... > &__in) noexcept(__nothrow_assignable< const
           _UElements &... >())
       template<typename... _UElements> constexpr __enable_if_t< __assignable<
           _UElements... >(), tuple & > operator= (tuple< _UElements... >
           &&__in) noexcept(__nothrow_assignable< _UElements... >())
       constexpr void swap (tuple &__in) noexcept(__and_<
           __is_nothrow_swappable< _Elements >... >::value)

if your eyes glazed over, valid, but every constructor, operator=, and swap is right there. the roster is complete, bestie 🫢πŸ”₯

🌸 Detailed Description 🌸

the detailed description is short and iconic:

   template<typename... _Elements>
       class std::tuple< _Elements >"Primary class template, tuple.

translation: this is the primary class template, tuple. also yes, that stray " is literally sitting there in the source text, and we are not fixing it β€” we respect the chaos 🫢

🫢 Author 🫢

the manual says, verbatim: Generated automatically by Doxygen for libstdc++ from the source code. so if the formatting feels a little Doxygen-core, that's why πŸ˜­πŸ’–


and that's the whole std::tuple< _Elements > page from the libstdc++ source, tagged as std::tuple< _Elements >(3cxx). there's no date on this footer, just the source/version vibe and the cxx manual name β€” mwah, go build something cute with your tuples πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from