It’s a relatively new conception in C++, you should avoid using it on
old C++ compiler. It inclueds two methods: typeid, dynamic_cast.
It only work with class hierarchy that has virtual functions.
typeid operator will return a type_info class. You need to include
typeinfo.h head file. Typeid operator receive pointer or class name.
If you just want to assure up casting and you don’t want to know more
about the class, you should prefer to use dynamic_cast . just know
typeid when you have a more complicated demand, you can come back
to take a look deeply.
Just like exception, It has some loss in performance, you can use flag
"-fno-rtti" to turn off it.