Is 'static foreach' sufficient for all needs or is there any value for
regular foreach over compile-time sequences?
Code unrelated to the question:
import std.stdio;
void main() {
// Old style compile-time foreach. This still works
// when 'static' is uncommented below.
import std.meta : AliasSeq;
/* static */ foreach (i; AliasSeq!(1, "hello", 2)) {
writeln(i);
}
// Proper 'static foreach'.
import std.range : iota;
import std.algorithm : map;
static foreach (i; 3.iota.map!(a => a * 10)) {
writeln(i);
}
}
Ali