Can I get an object\'s name in run time (like getting an object\'s type via RTTI)? I want the object to be able to print its name.
This may be GCC-specific:
#include #include template void foo(T t) { std::cout << typeid(t).name() << std::endl; }