13 #ifndef TINYMPL_VARIADIC_INSERT_HPP
14 #define TINYMPL_VARIADIC_INSERT_HPP
30 template<std::size_t pos,
class T,
template<
class ... >
class Out,class ... Args> struct
insert;
32 template<std::size_t pos,
class T,
template<
class ... >
class Out,class Head,class ... Args> struct
insert<pos,T,Out,Head,Args...>
35 template<
class ... CopiedElements>
38 typedef typename insert<pos-1,T,Out,Args...>::template impl<CopiedElements...,Head>::type type;
41 template<std::size_t,
class,
template<
class ... >
class,
class ...> friend struct
insert;
44 static_assert(pos <=
sizeof ... (Args) + 1,
"pos > sequence size!");
46 typedef typename impl<>::type type;
49 template<
class T,
template<
class ... >
class Out,class Head,class ... Args> struct
insert<0,T,Out,Head,Args...>
52 template<
class ... CopiedElements>
55 typedef Out< CopiedElements ..., T, Head,Args ... > type;
58 template<std::size_t,
class,
template<
class ... >
class,
class ...> friend struct insert;
61 typedef typename impl<>::type type;
64 template<
class T,
template<
class ... >
class Out> struct insert<0,T,Out>
67 template<
class ... CopiedElements>
70 typedef Out< CopiedElements ..., T > type;
73 template<std::size_t,
class,
template<
class ... >
class,
class ...> friend struct insert;
76 typedef typename impl<>::type type;
82 #endif // TINYMPL_VARIADIC_INSERT_HPP
Produce an output sequence from a variadic template inserting a new element at a given position...
Definition: insert.hpp:30
Insert a subsequence into a given sequence at a given position.
Definition: insert.hpp:36