__FILE__
和__LINE__
是众所周知的.C99之后有一个__func__
.
#include <iostream>
struct Foo {
void Do(){ std::cout << __func__ << std::endl; }
};
int main()
{
std::cout << __func__ << std::endl;
Foo foo; foo.Do();
return 0;
}
将输出
main
Do
是否有宏/关键字可以输出类似Foo::Do
的方法名称?