If Statement with Declaration

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 5 22:13:11 PDT 2016


On Sunday, 6 November 2016 at 05:07:10 UTC, Andrei Alexandrescu 
wrote:
> A more approachable thing to do is allow variable definitions 
> in switch statements:
>
> switch (auto x = fun() { ... }
>
> It is surprising that doesn't work, which is a good argument in 
> favor of the feature (removal of an undue limitation, rule of 
> least astonishment etc).

https://issues.dlang.org/show_bug.cgi?id=11070
lol


More information about the Digitalmars-d mailing list