enum scope

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 8 10:51:46 PDT 2014


On 6/7/2014 4:58 PM, deadalnix wrote:
> You can even use the with statement for code that use the enum
> intensively, for instance :
>
> final switch(myvar) with(UITableViewRowAnimation) {
>      case Fade:
>         // Do fading...
>      case Right:
>         // That's right...
>      case Left:
>         // That's not right..
>      // And so on...
> }

That use of with never occurred to me! It's cool.



More information about the Digitalmars-d mailing list