#include <iostream>
class A{
public:
void myfunction(){
std::cout << __func__;
}
};
int main(){
A obj;
obj.myfunction();
}
Output is myfunction. Unfortunately __funct__ does not work. How to output the fully qualified name of the member function i.e A::myfunction ?
There is no standard defined way for the same. However if you are using gcc you can use
__PRETTY_FUNCTION__instead of__func__.Standard C++ (i.e C++03) does not have either
__func__or__PRETTY_FUNCTION__.C++0x derives
__func__from C99 and it is defined in 8.4.2/8 (n3290)