Nested functions should be exempt from sequential visibility rules

Nick Sabalausky a at a.a
Tue Apr 3 05:00:29 PDT 2012


"Timon Gehr" <timon.gehr at gmx.ch> wrote in message 
news:jlej27$mvi$1 at digitalmars.com...
>
> This is the right way to work around this issue. It works now and does not 
> imply any kind of overhead at runtime:
>
> 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?

2. What, if any, problems would arise from just automatically doing that 
behind-the-scenes? Ie, to just automatically turn all non-templated nested 
functions into no-parameter templated nested functions? Would that be a 
feasable solution?




More information about the Digitalmars-d mailing list