Accessing types by context

Hiemlick Hiemlicker via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 28 22:06:08 PDT 2016


On Wednesday, 29 June 2016 at 03:50:35 UTC, Carl Vogel wrote:
> On Wednesday, 29 June 2016 at 03:11:52 UTC, Hiemlick Hiemlicker 
> wrote:
>> Suppose one has void test(myEnum e)
>>
>> enum myEnum
>> {
>> A,B,C
>> }
>>
>> [...]
>
> Doesn't the with statement solve your problem here?
>
> with (myEnum) {
>     test(A);
>     test(B);
>     test(C);
> }

Not really it's, only half the way there. Why not extend the 
language the extra step?




More information about the Digitalmars-d mailing list