On 25/02/2013 16:32, js.mdnq wrote:
We have __FILE__ and __LINE__. Is there a __FUNCTION__ that gives the
current function name? This helps with errors.

You can define a string mixin to use instead of __FUNCTION__:

enum string parentName = q{__traits(identifier, __traits(parent, {}))};

void main()
{
    writeln(mixin(parentName)); // prints "main"
}

Reply via email to