typeid expression required
Form here
The typeid expression is an lvalue expression that refers to a static object of the polymorphic type const std::type_info or some type derived from it.
Syntax: typeid (expression)
Checks expression expression
expression typeid evaluates the expression and then refers to the std::type_info , which represents the dynamic type of the expression.
If the expression is not a glvalue expression of a polymorphic type, typeid does not evaluate the expression, and the std::type_info object that it identifies is a static type of expression.
source share