@vitaut, ++ 11, , std::set_terminate.
, , std::terminate , , std::current_exception , , .
++ 11 N3242, 15.3.7 ():
, ( ) catch . [: . - end note] , , std:: terminate() std:: () - . , catch std:: () - .
Andrzej ++, , :
[[noreturn]] void onTerminate() noexcept
{
if( auto exc = std::current_exception() ) {
try{
rethrow_exception( exc );
}
catch( MyException const& exc ) {
}
catch( MyOtherException const& exc ) {
}
catch( std::exception const& exc ) {
}
catch( ... ) {
}
}
std::_Exit( EXIT_FAILURE );
}