Is there a way to get a function name within a function?
jicman
jicman at yahoo.com
Thu Dec 21 03:28:22 UTC 2017
On Wednesday, 20 December 2017 at 23:51:29 UTC, Johan Engelen
wrote:
> On Wednesday, 20 December 2017 at 23:28:46 UTC, jicman wrote:
>> Greetings!
>>
>> Imagine,
>>
>> //start
>> int getMe(int i)
>> {
>> writefln(__LINE__);
>> writefln(__FUNCTION_NAME__);
>
> So close! Use "__FUNCTION__" or "__PRETTY_FUNCTION__".
> https://dlang.org/spec/traits.html#specialkeywords
>
> -Johan
Thanks, Johan.
josé
More information about the Digitalmars-d-learn
mailing list