Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Name Current Function

Tags:

function

macros

d

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.

like image 629
Jeroen Avatar asked Nov 30 '25 19:11

Jeroen


1 Answers

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

like image 123
Adam D. Ruppe Avatar answered Dec 02 '25 15:12

Adam D. Ruppe