Is there a way to get a function name within a function?

jicman jicman at yahoo.com
Wed Dec 20 23:28:46 UTC 2017


Greetings!

Imagine,

//start
int getMe(int i)
{
   writefln(__LINE__);
   writefln(__FUNCTION_NAME__);
   return I + 1;
}

void main(args )
{
   getMe(1);
}
//end

So, the result would be,

4
getMe

So, is there a way to get the name of the function while in that 
function?  I know I can use some debugging and hard code it, but 
I would like to use it.

thanks.




More information about the Digitalmars-d-learn mailing list