On 02/07/12 17:48, Timon Gehr wrote:What would be your expected output?I'd expect to see 0 5 1 4 2 3 3 2 4 1 5 0i.e. as if I was foreach-ing over an array with the same values in inverted order.
Use the .array() property:
auto Range(alias func, Args...)(Args args) {
return func(args).array();
}
void main() {}
double[] ad = [ 0, 1, 2, 3, 4, 5 ];
foreach(index, x; Range!(retro)(ad)) {
writeln(index, "\t", x);
}
}
