[Issue 21287] Delegate in global template can't call non-anonymous nested function passed as alias

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 23 12:10:48 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21287

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
1. Lambdas that don't have any non-local access are implicitly typed as
function pointers.  So the equivalent nested function would be:

static void fun(Value)(Value _) {}

2. Template function literals are special in that they are implicitly enclosed
in their lexical context.  Nested function templates are not enclosed, and so
cannot access the surrounding frame when instantiated non-locally.

--


More information about the Digitalmars-d-bugs mailing list