Templates to manipulate template parameter sequences (also known as alias sequences).
Some operations on alias sequences are built into the language, such as S[i], which accesses the element at index i in the sequence. S[low .. high] returns a new alias sequence that is a slice of the old one.
For more information, see Compile-time Sequences.
Note: Several templates in this module use or operate on eponymous templates that take a single argument and evaluate to a boolean constant. Such templates are referred to as template predicates.
|Building blocks||Alias AliasSeq aliasSeqOf|
|Alias sequence filtering||Erase EraseAll Filter NoDuplicates Stride|
|Alias sequence type hierarchy||DerivedToFront MostDerived|
|Alias sequence transformation||Repeat Replace ReplaceAll Reverse staticMap staticSort|
|Alias sequence searching||allSatisfy anySatisfy staticIndexOf|
|Template predicates||templateAnd templateNot templateOr staticIsSorted|
|Template instantiation||ApplyLeft ApplyRight Instantiate|
References: Based on ideas in Table 3.1 from Modern C++ Design, Andrei Alexandrescu (Addison-Wesley Professional, 2001)
Allows aliasing of any single symbol, type or compile-time expression.
Creates a sequence of zero or more aliases. This is most commonly used as template parameters or arguments.
Instantiates the given template with the given parameters.
Checks if an AliasSeq is sorted according to cmp.
Partially applies Template by binding its first (left) or last (right) arguments to args.
Returns an AliasSeq with the elements of TList sorted so that the most derived types come first.
Returns an AliasSeq created from args[1 .. $] with the first occurrence, if any, of args removed.
Returns an AliasSeq created from args[1 .. $] with all occurrences, if any, of args removed.
Filters an AliasSeq using a template predicate. Returns an AliasSeq of the elements which satisfy the predicate.
Returns the type from TList that is the most derived from type T. If no such type is found, T is returned.
Returns an AliasSeq created from args with all duplicate types removed.
Creates an AliasSeq which repeats items exactly n times.
Returns an AliasSeq created from TList with the first occurrence of T, if found, replaced with U.
Returns an AliasSeq created from args[2 .. $] with all occurrences of args, if any, replaced with args.
Returns an AliasSeq created from args with the order reversed.
Selects a subset of Args by stepping with fixed stepSize over the sequence. A negative stepSize starts iteration with the last element.
Converts any foreach-iterable entity (e.g. an input range) to an alias sequence.
Tests whether all given items satisfy a template predicate, i.e. evaluates to F!(T) && F!(T) && ... && F!(T[$ - 1]).
Tests whether any given items satisfy a template predicate, i.e. evaluates to F!(T) || F!(T) || ... || F!(T[$ - 1]).
Returns the index of the first occurrence of args in the sequence args[1 .. $]. args may be types or compile-time values. If not found, -1 is returned.
Evaluates to AliasSeq!(fun!(args), fun!(args), ..., fun!(args[$ - 1])).
Sorts an AliasSeq using cmp.
Combines several template predicates using logical AND, i.e. constructs a new predicate which evaluates to true for a given input T if and only if all of the passed predicates are true for T.
Negates the passed template predicate.
Combines several template predicates using logical OR, i.e. constructs a new predicate which evaluates to true for a given input T if and only at least one of the passed predicates is true for T.