static switch

Timon Gehr timon.gehr at gmx.ch
Thu Mar 6 09:24:07 PST 2014


On 03/05/2014 11:41 PM, deadalnix wrote:
> On Wednesday, 5 March 2014 at 21:54:52 UTC, Timon Gehr wrote:
>> ...
>>
>> static if needs exactly the same thing, currently the following compiles:
>>
>> static if(is(int A)){}
>> A b; // meh
>>
>> It's pretty easy to solve: Just give static if/static foreach it's own
>> scope, but by default forward symbol insertions to the enclosing
>> scope. Symbols introduced by the construct itself are inserted
>> directly into its scope and not forwarded.
>>
>
> I don't think this is the right solution. Spewing error is better
> than overly complicated design.

I don't understand what your point is. Care to elaborate?


More information about the Digitalmars-d mailing list