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
  • 13,308
  • 11
  • 53
  • 98

1 Answers1

5

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

BCS
  • 71,616
  • 66
  • 178
  • 288
Adam D. Ruppe
  • 24,842
  • 4
  • 37
  • 58