#include #include #include //for set_terminate using namespace std; class pitcher { public: ~pitcher() throw (int) { cout << "~pitcher about to throw 20.\n"; throw 20; } }; void my_terminate(); int main() { set_terminate(my_terminate); try { pitcher pit; throw 10; } catch (int i) { cout << "main caught int " << i << ".\n"; } return EXIT_SUCCESS; } void my_terminate() { cerr << "my_terminate has been called.\n"; exit(EXIT_FAILURE); }