iotaTuple

Returns expression tuple with elements going through the numbers begin, begin + step, begin + 2 * step, ..., up to and excluding end. The two-arguments version has step = 1. The one-argument version also has begin = 0. If begin < end && step < 0 or begin > end && step > 0 or begin == end, then an empty tuple is returned.

Examples

int res;
foreach(i; iotaTuple!5) // same as res += foo!1(); res += foo!3();
	static if(i & 1)
		res += foo!i();

Tip: This is a convenient way to create a CT analog of Foreach Range Statement.

Analog of $(STDREF range, iota) for generic tuples.

Meta