How to get a function name (string) @ compile time

Arun Chandrasekaran aruncxy at gmail.com
Mon Dec 10 01:25:27 UTC 2018


On Sunday, 9 December 2018 at 03:29:27 UTC, Andrew Pennebaker 
wrote:
> On Monday, 3 November 2008 at 12:29:16 UTC, Simen Kjaeraas 
> wrote:
>> On Mon, 03 Nov 2008 12:33:05 +0100, Denis Koroskin 
>> <2korden at gmail.com> wrote:
>>
>>> [...]
>>
>> That's not the only error here. Your template function also 
>> calls
>> foo with no arguments on  the line below that bug. Fixing that 
>> would
>> probably include the ParameterTypeTuple and ReturnType 
>> templates.
>
> Er, when I try to use either foo.stringof, or 
> __trait(identifier, foo), I always get that binding name, 
> rather than the original function name, sad panda.
>
> I can only print out the current variable name, but I want to 
> print the name of the function declaration, no matter how 
> deeply I pass that first function pointer into different calls 
> :/

You may want to look at 
https://forum.dlang.org/post/yxobqahkvfcpcvidqppo@forum.dlang.org


More information about the Digitalmars-d-learn mailing list