От http://www.cplusplus.com/reference/exception/ Я извлек следующий псевдокод:
user-function throws an exception
does it match the exception-specification (throw() in signature)?
yes: does it match a catch block (also for base classes) at any nesting level?
yes: run the catch block
no: call terminate
no: call unexpected
does user-function have bad_exception in its exception-specification?
yes: does unexpected rethrow it or throws any other exception also not in the
exception-specification?
yes: throw bad_exception
terminate
the function set with set_terminate, default abort()
unexpected
the function set with set_unexpected, default terminate
uncaught_exception
returns true if an exception has been thrown and has not yet been caught by its appropriate handler, false otherwise
may call terminate if another exception is thrown while this function returns true
Как видите, есть пара «да» без какого-либо корреспондента «нет». Кроме того, я узнал, что unexpected
устарела. Есть ли что-то на его месте, или оно просто исчезло? Ссылка на простую, понятную и лаконичную страницу об исключениях была бы хорошим ответом, но если вы могли бы помочь завершить псевдокод, это тоже было бы очень хорошо.
Задача ещё не решена.
Других решений пока нет …