Behaviour of exception handling in constructor of a class
问题 I have this program where the ctor of derived class throws a exception. The program is just an example program where I am just trying to understand the concept of exception handling. class A{ public: A() {} ~A(){std::cout << "DTOR called - A!!" << std::endl;} }; class B : public A { public: B():A() { try { init(); } catch(...) { std::cout << "Inside catch block in B's Ctor!!" << std::endl; throw this; } } void init() { throw 0; } ~B() {std::cout << "DTOR called - B!!" << std::endl; } }; int