Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 919 Bytes

Append.md

File metadata and controls

37 lines (27 loc) · 919 Bytes

<CppML/Pack/Append.hpp>

Append

template <typename T, typename Pipe = ml::ToList>
struct Append {
  template <typename ...Ts>
  using f = /* .... */;
};

Append<T, Pipe>

Append<T, Pipe> is a metafunction that passes to Pipe the parameter pack Ts..., with T appended; i.e. Ts..., T. Pipe defaults to ml::ToList.

f:: Ts... -> Ts..., T >-> Pipe

NOTE

If you have a need to append more than one element to a parameter pack being passed to Pipe, you should be looking at partial evaluations from the right, ml::PartialR, from the Functional header.

Example

using AF = ml::Append<int, ml::F<std::tuple>>;

using T = ml::f<
               AF,
               std::string>;
static_assert(
              std::is_same_v<
                  T,
                  std::tuple<std::string, int>>);