template <int N, typename T, typename Pipe = ml::ToList>
struct Insert {
template <typename ...Ts>
using f = /* .... */;
};
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
.
using T = ml::f<
ml::Insert<2, double>,
int, char, bool>;
static_assert(
std::is_same_v<
T,
ml::ListT<
int, char, double, bool>>);