I have a feature request: "Named enum scope inference"

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Sep 28 20:12:30 PDT 2012


On 9/29/12, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> you could simply use with to solve the problem:
>
> with(MyFruit)
> {
>     switch(fruit)
>     {
>         case apple: break;
>         case orange: break;
>         case banana: break;
>     }
> }
>

It's even simpler:
switch(fruit) with (MyFruit)
{
    case apple: break;
    case orange: break;
    case banana: break;
}


More information about the Digitalmars-d mailing list