downs wrote:
Static loops are simple, at least in functions.

import std.stdio;

template Tuple(T...) { alias T Tuple; }
template Repeat(T, int I) { static if (!I) alias Tuple!() Repeat; else alias 
Tuple!(T, Repeat!(T, I-1)) Repeat; }

void main() {
  foreach (i, bogus; Repeat!(void, 15))
    writefln(i);
}

I know, but at about the fiftienth one you get sick of it. And generating code in a static loop is much harder.

Andrei

Reply via email to