Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Metaprogramming with type sequences based on variadic template parameters.
The type rebinding- and helper templates in this header allow to perform simple sequence manipulations on sequences of template parameters extracted from variadic parameter packs. The goal is to (pre)process flexible argument lists at compile time, driven by template instantiation, allowing to specialise and react specifically on some concrete pattern of argument types.
Definition in file variadic-helper.hpp.
#include "lib/meta/typelist.hpp"
#include "lib/meta/typelist-util.hpp"
#include "lib/meta/typeseq-util.hpp"
#include "lib/meta/util.hpp"
Classes | |
struct | BuildIdxIter< TYPES > |
build a sequence of index numbers based on a type sequence More... | |
struct | BuildIdxIter< Types< TYPES... > > |
build an index number sequence from a type sequence More... | |
struct | BuildIndexSeq< n > |
build regular sequences of index number e.g. More... | |
struct | BuildIndexSeq< 0 > |
struct | IndexSeq< idx > |
Hold a sequence of index numbers as template parameters. More... | |
struct | Prepend< T, TySeq< TYPES... > > |
temporary workaround: additional specialisation for the template Prepend to work also with the (alternative) variadic TySeq. More... | |
struct | RebindVariadic< X, ARGS > |
Metaprogramming helper to transfer variadic arguments. More... | |
struct | RebindVariadic< X, U< ARGS... > > |
struct | SelectOrInit< bool, typename, idx > |
struct | SelectOrInit< false, DEFAULT, idx > |
struct | SelectVararg< i > |
struct | SelectVararg< 0 > |
struct | StripNullType< SEQ > |
temporary workaround: strip trailing NullType entries from a type sequence, to make it compatible with new-style variadic template definitions. More... | |
struct | StripNullType< Types< NullType, TYPES... > > |
struct | StripNullType< Types< T, TYPES... > > |
struct | TySeq< TYPES > |
temporary workaround: alternative definition of "type sequence", already using variadic template parameters. More... | |
Functions | |
template<typename X > | |
constexpr X const & | max (X const &a, X const &b) |
template<typename X > | |
constexpr X const & | min (X const &a, X const &b) |
template<size_t idx, typename... ARGS> | |
constexpr auto | pickArg (ARGS &&... args) |
Helper to single out one argument from a variadic argument pack. More... | |
template<size_t idx, typename DEFAULT , typename... ARGS> | |
constexpr auto | pickInit (ARGS &&... args) |
Helper to pick one initialisation argument from a variadic argument pack, falling back to a default constructed element of type DEFAULT in case of insufficient number of variadic arguments. More... | |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |
|
inline |
Helper to single out one argument from a variadic argument pack.
idx | the index number (zero based) of the argument to select |
Definition at line 346 of file variadic-helper.hpp.
References lib::meta::pickArg().
Referenced by lib::meta::pickArg().
|
inline |
Helper to pick one initialisation argument from a variadic argument pack, falling back to a default constructed element of type DEFAULT
in case of insufficient number of variadic arguments.
idx | the index number (zero based) of the argument to select |
DEFALUT | type of the default element to construct as fallback |
Definition at line 362 of file variadic-helper.hpp.
References lib::meta::pickInit().
Referenced by lib::meta::pickInit().