Getting symbol of current function?

Tomer Filiba tomerfiliba at gmail.com
Fri Dec 7 10:51:38 UTC 2018


Is there some clever way to get the *symbol* of the current 
function, given overloads? I want to log the current function's 
arguments, but __FUNCTION__ et al only give me a name, which 
resolves to the first overload. For instance,

     void f(int x) {
         pragma(msg, "overload1", 
Parameters!(mixin(__FUNCTION__)));
     }
     void f(int x, int y) {
         pragma(msg, "overload2", 
Parameters!(mixin(__FUNCTION__)));
     }

shows
     overload1(int)
     overload2(int)

It would be awesome to have something like __FUNCTION_SYM__ or 
so, which references the actual symbol.

-tomer


More information about the Digitalmars-d mailing list