43 #ifndef LIB_META_VARIADIC_HELPER_H 44 #define LIB_META_VARIADIC_HELPER_H 67 template<
typename...TYPES>
71 using List =
typename Types<TYPES...>::List;
80 template<
typename T,
typename...TYPES>
84 using List =
typename Types<T, TYPES...>::List;
96 template<
typename SEQ>
99 template<
typename T,
typename...TYPES>
107 template<
typename...TYPES>
121 constexpr
inline X
const&
122 max (X
const& a, X
const& b)
128 constexpr
inline X
const&
129 min (X
const& a, X
const& b)
145 template<
size_t...idx>
162 using Ascending =
typename BuildIndexSeq<n-1>::Ascending::template AppendElm<n-1>;
163 using Descending =
typename BuildIndexSeq<n-1>::Descending::template PrependElm<n-1>;
166 using OffsetBy =
typename BuildIndexSeq<n-1>::template OffsetBy<d>::template AppendElm<n-1+d>;
169 using FilledWith =
typename BuildIndexSeq<n-1>::template FilledWith<x>::template AppendElm<x>;
172 using First =
typename BuildIndexSeq<min(c,n)>::Ascending;
204 template<
typename...TYPES>
207 enum {SIZ =
sizeof...(TYPES) };
210 using Ascending =
typename Builder::Ascending;
211 using Descending =
typename Builder::Descending;
214 using OffsetBy =
typename Builder::template OffsetBy<d>;
217 using FilledWith =
typename Builder::template FilledWith<x>;
220 using First =
typename Builder::template First<c>;
223 using After =
typename Builder::template After<c>;
227 template<
typename...TYPES>
234 using Ascending =
typename Builder::Ascending;
235 using Descending =
typename Builder::Descending;
238 using OffsetBy =
typename Builder::template OffsetBy<d>;
241 using FilledWith =
typename Builder::template FilledWith<x>;
244 using First =
typename Builder::template First<c>;
247 using After =
typename Builder::template After<c>;
263 template<
template<
typename...>
class X,
typename...ARGS>
266 using Type = X<ARGS...>;
269 template<
template<
typename...>
class X
270 ,
template<
typename...>
class U
274 using Type = X<ARGS...>;
294 template<
typename ARG,
typename...ARGS>
296 get (ARG, ARGS&& ...args)
305 template<
typename ARG,
typename...ARGS>
307 get (ARG&& a, ARGS...)
309 return std::forward<ARG>(a);
318 template<
bool,
typename,
size_t idx>
323 template<
typename DEFAULT,
size_t idx>
326 template<
typename...ARGS>
344 template<
size_t idx,
typename...ARGS>
345 constexpr
inline auto 348 static_assert (idx <
sizeof...(args),
"insufficient number of arguments");
350 return SelectVararg<idx>::get (std::forward<ARGS> (args)...);
360 template<
size_t idx,
typename DEFAULT,
typename...ARGS>
361 constexpr
inline auto 364 return SelectOrInit<(idx <
sizeof...(args)), DEFAULT, idx>::get (std::forward<ARGS> (args)...);
A template metaprogramming technique for manipulating collections of types.
Metaprogramming: simple helpers for working with lists-of-types.
Some basic facilities for manipulating type sequences.
Implementation namespace for support and library code.
constexpr auto pickInit(ARGS &&... args)
Helper to pick one initialisation argument from a variadic argument pack, falling back to a default c...
constexpr auto pickArg(ARGS &&... args)
Helper to single out one argument from a variadic argument pack.