InterleaveNLists

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

template InterleaveNLists (
uint n
T...
) if (
T.length % n == 0
) {}

Members

Aliases

InterleaveNLists
alias InterleaveNLists = Map!(Group, Iota!(T.length / n))
Undocumented in source.

Templates

Group
template Group(uint i)
Undocumented in source.

Examples

static assert (InterleaveNLists!(2, 0,1,2,3,4,5) == Cons!(0,3,1,4,2,5));
static assert (InterleaveNLists!(3, 0,1,2,3,4,5) == Cons!(0,2,4,1,3,5));

Meta