![]() |
Lumiera 0.pre.04
»edit your freedom«
|
Metaprogramming with type sequences based on variadic template parameters. More...
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.
Types<T...> can be primed / rebound from other variadic templatesDefinition 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/variadic-rebind.hpp"#include "lib/meta/util.hpp"Namespaces | |
| namespace | lib |
| Implementation namespace for support and library code. | |
| namespace | lib::meta |
| namespace | lib::meta::anonymous_namespace{variadic-helper.hpp} |
Classes | |
| struct | IndexSeq< idx > |
| Hold a sequence of index numbers as template parameters. More... | |
| struct | BuildIndexSeq< n > |
| build regular sequences of index number e.g. More... | |
| struct | BuildIndexSeq< 0 > |
| 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 | ElmTypes< X, typename > |
| Variadic type sequence builder. More... | |
| struct | ElmTypes< Types< TYPES... > > |
| Partial specialisation to handle type sequences. More... | |
| class | WithIdxSeq< N > |
| helper to invoke a functor, passing instances of std::integral_constant More... | |
| struct | SelectVararg< i > |
| struct | SelectVararg< 0 > |
| struct | SelectOrInit< bool, typename, idx > |
| struct | SelectOrInit< false, DEFAULT, idx > |
Functions | |
| template<class TTX , class FUN > | |
| void | forEachIDX (FUN &&fun) |
| Invoke a function (or λ) with index numbers derived from some variadic count. | |
| template<class TTX , class FUN > | |
| bool | andAllIDX (FUN &&fun) |
| template<class TTX , class FUN > | |
| bool | orAnyIDX (FUN &&fun) |
| template<size_t idx, typename... ARGS> | |
| constexpr auto | pickArg (ARGS &&... args) |
| Helper to single out one argument from a variadic argument pack. | |
| 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. | |
| struct lib::meta::IndexSeq |
| struct lib::meta::BuildIndexSeq |
| Class Members | ||
|---|---|---|
| typedef template AppendElm< n-1 > | Ascending | |
| typedef template PrependElm< n-1 > | Descending | |
| typedef template template AppendElm< n-1+d > | OffsetBy | |
| typedef template template AppendElm< x > | FilledWith | |
| typedef Ascending | First | |
| typedef BuildIndexSeq<(n >c)? n-c :0 >::template OffsetBy< c > | After | |
Collaboration diagram for BuildIndexSeq< n >: