#include #include using namespace std; class even { int i; public: even(int initial_i) throw (int): i(initial_i) { cout << "constructor for even " << i << " started "; if (i % 2 != 0) { throw i; } cout << "and finished.\n"; } ~even() {cout << "\ndestruct even " << i << "\n";} }; class big { even e1; even e2; even e3; public: big(int initial_e1, int initial_e2, int initial_e3) throw (int) : e1(initial_e1), e2(initial_e2), e3(initial_e3) { cout << "construct big\n"; } ~big() {cout << "destruct big\n";} }; int main() { try { big b(10, 21, 30); } catch (int i) { cerr << "main caught the integer " << i << ".\n"; return EXIT_FAILURE; } return EXIT_SUCCESS; }