Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <typeinfo> //for 'typeid' to work
  3. #include <typeindex>
  4.  
  5. using namespace std;
  6.  
  7. class Base {};
  8.  
  9. int main() {
  10. cout << typeid(Base).name() << endl; // 4Base
  11. cout << type_index(typeid(Base)).name() << endl; // 4Base
  12. cout << typeid(type_index(typeid(Base))).name() << endl; // NSt3__110type_indexE
  13. cout << type_index(typeid(type_index(typeid(Base)))).name() << endl; // NSt3__110type_indexE
  14.  
  15. return 0;
  16. }
Add Comment
Please, Sign In to add comment