![]() |
bad_cast |
Type of the exceptions thrown by dynamic_cast when they fail the run-time check performed on references to polymorphic class types.
The run-time check fails if the object would be an incomplete object of the destination type.
Its member what returns a null-terminated character sequence identifying the exception.
Some functions in the standard library may also throw this exception to signal a type-casting error.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Possible output:
bad_cast caught: St8bad_cast |
See also
| exception | Standard exception class (class) |

