Possible Duplicate:
Macro / keyword which can be used to print out method name?
Is there an effective way in C++ to retrieve full signature of a function at run-time?
I need this for logging purpose. I'm aware of macro like __FUNCTION__
, but doesn't serve the purpose as it just returns the function names. There could be many overloaded versions of same function, I want to log the full function signature. I'm looking for a solution that work correctly if even function signature is modified. The solution should always log the current function signature
void log(const char* const message)
{
cout << message << endl;
}
void ABC(const int& number)
{
Log(???); // what should I pass to this function so full signature of the ABC function is logged??
}