Advertisement
StephanieRct

Need type name at runtime and no RTTI?

Aug 20th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. class MyTypeInfo{
  2. public:
  3.     template<typename T>
  4.     static const char * Name(){
  5.         const char * n = strstr(__PRETTY_FUNCTION__, "with T = ") + 9;
  6.         return n;
  7.     }
  8. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement