std::bad_typeid
From cppreference.com
Defined in header <typeinfo>
|
||
class bad_typeid : public std::exception; |
||
An exception of this type is thrown when a typeid operator is applied to a dereferenced null pointer value of a polymorphic type.
Member functions
constructs a new bad_typeid object (public member function) |
Inherited from std::exception
Member functions
[virtual] |
destructs the exception object (virtual public member function of std::exception ) |
[virtual] |
returns an explanatory string (virtual public member function of std::exception ) |
Example
Run this code
Output:
Attempted a typeid of NULL pointer!