June 2025
Intermediate to advanced
1093 pages
33h 24m
English
The <typeinfo> header actually contains only a few things:
Operator typeid()A function-like operator for determining a unique identification
Class type_infoThe return type of typeid()
Exceptions bad_cast and bad_typeidThe exceptions that occur in the context of dynamic types
This is a little bit of a lie: typeid() is similar to sizeof() in that it is not a function but an operator, and typeid is even a keyword. However, you must include the <typeinfo> header before using typeid(); otherwise it is an error. Therefore, you can think of typeid() as a function defined in the header.
With this “function,” you can get information about a type that you specify as a parameter, ...
Read now
Unlock full access