3

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.

Jeroen
  • 15,257
  • 12
  • 59
  • 102

1 Answers1

5

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

BCS
  • 75,627
  • 68
  • 187
  • 294
Adam D. Ruppe
  • 25,382
  • 4
  • 41
  • 60