Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <typeinfo> //for 'typeid' to work
- #include <typeindex>
- using namespace std;
- class Base {};
- int main() {
- cout << typeid(Base).name() << endl; // 4Base
- cout << type_index(typeid(Base)).name() << endl; // 4Base
- cout << typeid(type_index(typeid(Base))).name() << endl; // NSt3__110type_indexE
- cout << type_index(typeid(type_index(typeid(Base)))).name() << endl; // NSt3__110type_indexE
- return 0;
- }
Add Comment
Please, Sign In to add comment