C++ Language/Type/Rtti

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The C++ standard provides rather little support for RTTI. You can call typeid(int), which returns a const std::type_info& that can be equated (using ==) or converted into string (using .name()).

Additional information about RTTI