__FUNC__ in D

BCS ao at pathlink.com
Tue Aug 14 13:43:02 PDT 2007


Reply to Jarrett,

> "argl" <cavenhaus at gmail.com> wrote in message
> news:f9qrup$nqe$1 at digitalmars.com...
> 
>> Hi, I know this has come aup a few times in the past, but I have not
>> come across a clear answer.
>> 
>> Is it possible in any way to get the name of the current function for
>> logging purposes? Something to get the functionality of __FUNC__ in
>> C?
>> 
> No.
> 

CTFE anyone?

char[] GetLastFnDef(char[] file, int line);

use like this:

const char[] fn = GetLastFnDef(import(__FILE__), __LINE__);




More information about the Digitalmars-d-learn mailing list