Defined in Member types operator operator< > Append Grows the product without nesting appending a value adds one field and appending a pack splices its fields in Apply Elimination the elements spread into a callable as separate arguments apply_r as_pack get The product payload all fields present strictly flat A tuple like structure supporting the tuple protocol get tuple_size tuple_element structured bindings and an append mechanism Unlike std tuple a pack is not a valid element of a pack appending one splices its fields in rather than nesting it Elements may be lvalue references pack<T&> is how the other carriers propagate references and a const pack propagates its const onto reference elements handing out read only views of the referenced data pack<> is the nullary product the algebra s unit a value that exists and holds nothing where the uninhabited copack<> is the zero A structural type when its elements are so a constexpr pack can be used as a template parameter template <typename T> using append_type _impl template append_type<T> 1 The pack type that appending a T yields constexpr auto operator pack const &other const > bool 1 Compares two packs of the same type element by element < > lexicographically Every element decides one that cannot be compared leaves the operator non viable which asking answers rather than erroring on and a reference element compares its referent as fn optional<T&> and std tuple do < > asks each element for its own synthesizing no ordering from < < > < and > follow from these two by rewriting constexpr auto operator< > pack const &other const 1 Orders two packs lexicographically element by element template <typename T> constexpr auto append std in_place_type_t<T> auto && args & > append_type<T> 1 constexpr auto append std in_place_type_t<T> auto && args const & > append_type<T> 2 constexpr auto append std in_place_type_t<T> auto && args && > append_type<T> 3 constexpr auto append std in_place_type_t<T> auto && args const && > append_type<T> 4 template <typename Arg> constexpr auto append Arg &&arg & > append_type<Arg> 5 constexpr auto append Arg &&arg const & > append_type<Arg> 6 constexpr auto append Arg &&arg && > append_type<Arg> 7 constexpr auto append Arg &&arg const && > append_type<Arg> 8 Appends an element of type T constructed in place from the arguments A pack for T splices its fields in packs stay strictly flat and a copack is not a valid element at all The result is a new pack the existing elements are copied or moved in *this s value category so a const pack with a reference element is not appendable const propagates through the reference and the new pack s element cannot bind it return A new pack with the new element at the end args auto && Arguments to construct the new element from return A new pack with the new element at the end args auto && Arguments to construct the new element from Appends a value a pack argument splices its fields in Packs stay strictly flat appending a pack appends its fields never a nested pack The result is a new pack the existing elements are copied or moved in *this s value category return A new pack with the addition at the end arg Arg && Value to append or a pack whose fields to append template <typename Fn> constexpr auto apply Fn &&fn auto && args & > decltype auto 1 constexpr auto apply Fn &&fn auto && args const & > decltype auto 2 constexpr auto apply Fn &&fn auto && args && > decltype auto 3 constexpr auto apply Fn &&fn auto && args const && > decltype auto 4 Eliminates the pack the elements spread into the callable as separate arguments The bridge between the product as stored and the product as an argument list pack<A B> invokes f a b and pack<> invokes f The elements are handed over in *this s cv qualification and value category and trailing arguments follow them return The callable s result fn Fn && Callable applied on the elements args auto && Additional arguments appended after the elements template <typename Ret typename Fn> constexpr auto apply_r Fn &&fn auto && args & > Ret 1 constexpr auto apply_r Fn &&fn auto && args const & > Ret 2 constexpr auto apply_r Fn &&fn auto && args && > Ret 3 constexpr auto apply_r Fn &&fn auto && args const && > Ret 4 Eliminates the pack converting the result to Ret return The callable s result converted to Ret fn Fn && Callable applied on the elements args auto && Additional arguments appended after the elements return The callable s result converted to Ret fn Fn && Callable applied on the elements args auto && Additional arguments appended after the elements constexpr auto as_pack > pack<> 1 template <typename Explicit typename T typename Args> constexpr auto as_pack T &&src Args && args > pack<T Args > 2 template <typename T typename Args> constexpr auto as_pack std type_identity_t<T> src std type_identity_t<Args> args > pack<T Args > 3 Lifts no values into the empty pack the unit Lifts values into a pack deduction preserving each argument s value category as_pack 42 yields pack<int> an lvalue x yields pack<int &> a reference rather than a copy return The new pack src T && First value to lift args Args && Further values to lift Lifts values into a pack of exactly the spelled element types as_pack<bool int> x d converts each argument at the call boundary every element type must be spelled a partial spelling is not viable and a reference element is what you ask for as in as_pack<int const &> x return The new pack src std type_identity_t< T > First value converted to T args std type_identity_t< Args > Further values converted to Args return The new pack src std type_identity_t< T > First value converted to T args std type_identity_t< Args > Further values converted to Args template <typename Cp> constexpr auto get Cp &&c > decltype auto 1 template <std size_t I some_pack P> constexpr auto get P &&p > decltype auto 2 Accesses the sole alternative of a singular copack Only a copack with exactly one alternative qualifies the access needs no dispatch and cannot miss Returns the alternative carrying the copack s cv qualification and value category exactly as apply would pass it return Reference to the sole alternative c Cp && The singular copack in any value category Tuple protocol element access Returns the I th element carrying the pack s cv qualification and value category exactly as apply would pass it Found by ADL so it also serves structured bindings and the generic using std get get<I> p idiom return reference to the I th element p P && the pack return reference to the I th element p P && the pack