![]() |
bad_exception |
This is a special type of exception specifically designed to be listed in the exception-specification of a function (i.e., in its throw specifier).
If a function with bad_exception listed in its exception-specification throws an exception not listed in it and unexpected rethrows it (or throws any other exception also not in the exception-specification), a bad_exception is automatically thrown.
Its member what returns a null-terminated character sequence identifying the exception.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Output:
unexpected handler called caught bad_exception |
See also
| unexpected_handler | Type of unexpected handler function (type) |

