Search code examples
functionmacrosd

Get Name Current Function


Is there a way to get the name of the current function in D? I'm looking for something similar to __FUNCTION__ in C++.

I would like to use this name to pass it into an Exception. The Exception would get thrown if a function is not supported (yet) for the current platform the user is on.


Solution

  • __FUNCTION__ should work, even as a default argument to another function or exception constructor so it is filled in automatically.