static foreach

Navin Kumar navinkumar+dlang at gmail.com
Sun Mar 28 17:18:48 PDT 2010


bearophile Wrote:
> [Later if Walter finds a way to implement, the static foreach can be made richer, for example letting the compiler translate "static foreach (i; 10 .. 20)" in a "static foreach (i; Range!(10, 20))". And even later if Walter is able the whole thing can be allowed outside functions.]


I like the idea of having an intermediate solution like that.  D1 currently supports "foreach(i; Range!(10,20))" inside functions and so a quick solution is to allow "static foreach(i; Range!(10,20))" and "static foreach(i; 10..20)" inside functions.



More information about the Digitalmars-d mailing list