#include #include void notstand() { std::cerr << "... wird es auch schief gehen." << endl; throw bad_exception(); } class X {}; class U {}; void harmlos() throw(U) // wirklich ??? { throw X(); } int main() { std::unexpected_handler old = std::set_unexpected(notstand); try { std::cout << "Was schiefgehen kann, ..." << std::endl; harmlos(); unexpected(); } catch(bad_exception& ) { std::cerr << "\t(Murphy's Gesetz)\n"; } catch(...) { std::cerr << "...und zwar anders, als man erwartet.\n"; } return 0; }