Testing whether static foreach is available

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 9 19:13:58 PDT 2017


On Sunday, 10 September 2017 at 01:49:42 UTC, Mike Parker wrote:
>
> But Adam's point about the false branch still holds, so:
>
> static if(__VERSION__ >= 2076)
>     mixin(`static foreach(i; 0..3) writeln(i);`);
> else
>     writeln("Version too low");
>
> The same is true for version statements.

But it would work for changes to phobos, right? So there's a 
silver lining ;)


More information about the Digitalmars-d mailing list