Nested functions should be exempt from sequential visibility rules

Martin Nowak dawg at dawgfoto.de
Tue Apr 3 13:42:10 PDT 2012


>>> void foo(){
>>>      void a()(){ ... }
>>>      void b()  { ... }
>>> }
>>>
>>
>> That's a very simple workaround (albiet unintuitive - unless I'm just  
>> too
>> tired right now). It leads me to two questions:
>>
>> 1. How the heck does that work?
>>
>
> Symbol lookup is done upon the first instantiation of the local template.
>

I'd argue it shouldn't work, but it'd require copying the scope.
instantiation scope -> declaration scope -> sequence snapshot
So again b shouldn't be is a's scope.


More information about the Digitalmars-d mailing list