Shouldn't __FUNCTION__ return function name?

Andrea Fontana via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 28 08:35:08 PDT 2015


On Tuesday, 28 July 2015 at 15:13:28 UTC, Steven Schveighoffer 
wrote:
>> How can I get the function name?
>
> Be outside foreach. The way foreach works in many cases 
> (including foreach over an associative array), is that the 
> compiler constructs an internal function delegate, then passes 
> it to a handler. See opApply and how it works. It's the same 
> for AAs.
>
> http://dlang.org/statement.html#ForeachStatement
>
> -Steve

Too bad :|


More information about the Digitalmars-d-learn mailing list