Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 812 Bytes

Insert.md

File metadata and controls

36 lines (27 loc) · 812 Bytes

<CppML/Pack/Insert.hpp>

Insert

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

Insert<N, T, Pipe>

Insert<N, T, Pipe> is a metafunction that passes to Pipe the parameter pack Us..., which is generated by inserting T as the N-th element of the parameter pack Ts.... Pipe defaults to ml::ToList.

f::  Ts... -> Us... >-> Pipe

NOTE

Indexing starts at 0.

Example

using T = ml::f<
               ml::Insert<2, double>,
               int, char, bool>;
static_assert(
              std::is_same_v<
                            T,
                            ml::ListT<
                                  int, char, double, bool>>);