evx.meta.list

Undocumented in source.

Members

Aliases

Cons
alias Cons(T...) = T

construct a list, which automatically flattens

Deinterleave
alias Deinterleave(T...) = DeinterleaveNLists!(2, T)

shorthand for (de)interleaving templates

DeinterleaveNLists
alias DeinterleaveNLists(uint n, T...) = InterleaveNLists!(T.length / n, T)

partition a list into equivalence classes of each element's order modulo n

Enumerate
alias Enumerate(T...) = Zip!(Pack!(Ordinal!T), Pack!T)

pair each element's position in the list with the element

IndexOf
alias IndexOf = staticIndexOf

find the index of the first occurence of an item in a list, or -1

Interleave
alias Interleave(T...) = InterleaveNLists!(2, T)

shorthand for (de)interleaving templates

Iota
alias Iota(size_t n) = staticIota!(0, n)
alias Iota(size_t l, size_t r) = staticIota!(l, r)

generate a sequence of contiguous natural numbers

NoDuplicates
alias NoDuplicates = std.typetuple.NoDuplicates

from a given list, produce a new list containing only unique items

Ordinal
alias Ordinal(T...) = Iota!(T.length)

map each element of a list to its position in the list

Repeat
alias Repeat(size_t n, T...) = Cons!(T, Repeat!(n - 1, T))
alias Repeat(size_t n : 0, T...) = Cons!()

repeat an argument a given number of times

Reverse
alias Reverse = std.typetuple.Reverse

reverse the order of a list

Sum
alias Sum(T...) = Reduce!(λ!q{(long a, long b) = a + b}, T)

sum a list

Enums

Contains
eponymoustemplate Contains(T...)

evaluates true if a list contains a given item

Structs

Pack
struct Pack(T...)

a pack is a list which doesn't automatically flatten

Templates

All
template All(alias cond, T...)

evaluates true if all items in the list satisfy the condition

Any
template Any(alias cond, T...)

evaluates true if any items in the list satisfy the condition

Extract
template Extract(string member, T...)

map each item in a list to the given member in each item

Filter
template Filter(alias cond, T...)

from a given list, produce a new list containing only items which satisfy a condition

First
template First(T...)

get the first element of a list

InterleaveNLists
template InterleaveNLists(uint n, T...)

split a list into n-lists and interleave their items into a new list

Map
template Map(alias F, T...)

map a template over a list

MatchAll
template MatchAll(patterns...)

get all items in a list of zero-parameter templates which successfully compiles

Reduce
template Reduce(alias f, T...)

reduce a list to a single item using a binary template

Scan
template Scan(alias f, T...)

from a given list, produce a list of all partial reductions, sweeping from left to right

Second
template Second(T...)

get the second element of a list

Sort
template Sort(T...)

sort a list by <

SortBy
template SortBy(alias compare, T...)

sort a list by a custom comparison

Swap
template Swap(uint i, uint j, T...)

swap the two elements in a compile-time list indexed by i and j

Unpack
template Unpack(T...)

unpack a packed list, and pass non-pack parameters through unmodified

Zip
template Zip(Packs...)

from a list of n packs of length m, produce a list of m packs of length n

Meta