expand

Expand Static array into a parameter arguments (AliasSeq!).

template expand (
alias array
size_t idx = 0
) if (
__traits(isStaticArray, typeof(array))
) {}

Examples

static void foo(int a, int b, int c)
{
    import std.stdio: writefln;
    version(print) writefln("a: %s, b: %s, c: %s", a, b, c);
}
int[3] arr = [1, 2, 3];
foo(expand!arr);

See Also

Meta