52 #ifndef LIB_META_VARIADIC_HELPER_H 53 #define LIB_META_VARIADIC_HELPER_H 76 template<
typename...TYPES>
80 using List =
typename Types<TYPES...>::List;
89 template<
typename T,
typename...TYPES>
93 using List =
typename Types<T, TYPES...>::List;
105 template<
typename SEQ>
108 template<
typename T,
typename...TYPES>
116 template<
typename...TYPES>
130 constexpr
inline X
const&
131 max (X
const& a, X
const& b)
137 constexpr
inline X
const&
138 min (X
const& a, X
const& b)
154 template<
size_t...idx>
171 using Ascending =
typename BuildIndexSeq<n-1>::Ascending::template AppendElm<n-1>;
172 using Descending =
typename BuildIndexSeq<n-1>::Descending::template PrependElm<n-1>;
175 using OffsetBy =
typename BuildIndexSeq<n-1>::template OffsetBy<d>::template AppendElm<n-1+d>;
178 using FilledWith =
typename BuildIndexSeq<n-1>::template FilledWith<x>::template AppendElm<x>;
181 using First =
typename BuildIndexSeq<min(c,n)>::Ascending;
213 template<
typename...TYPES>
216 enum {SIZ =
sizeof...(TYPES) };
219 using Ascending =
typename Builder::Ascending;
220 using Descending =
typename Builder::Descending;
223 using OffsetBy =
typename Builder::template OffsetBy<d>;
226 using FilledWith =
typename Builder::template FilledWith<x>;
229 using First =
typename Builder::template First<c>;
232 using After =
typename Builder::template After<c>;
236 template<
typename...TYPES>
243 using Ascending =
typename Builder::Ascending;
244 using Descending =
typename Builder::Descending;
247 using OffsetBy =
typename Builder::template OffsetBy<d>;
250 using FilledWith =
typename Builder::template FilledWith<x>;
253 using First =
typename Builder::template First<c>;
256 using After =
typename Builder::template After<c>;
272 template<
template<
typename...>
class X,
typename...ARGS>
275 using Type = X<ARGS...>;
278 template<
template<
typename...>
class X
279 ,
template<
typename...>
class U
283 using Type = X<ARGS...>;
303 template<
typename ARG,
typename...ARGS>
305 get (ARG, ARGS&& ...args)
314 template<
typename ARG,
typename...ARGS>
316 get (ARG&& a, ARGS...)
318 return std::forward<ARG>(a);
327 template<
bool,
typename,
size_t idx>
332 template<
typename DEFAULT,
size_t idx>
335 template<
typename...ARGS>
353 template<
size_t idx,
typename...ARGS>
354 constexpr
inline auto 357 static_assert (idx <
sizeof...(args),
"insufficient number of arguments");
359 return SelectVararg<idx>::get (std::forward<ARGS> (args)...);
369 template<
size_t idx,
typename DEFAULT,
typename...ARGS>
370 constexpr
inline auto 373 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.