because in this scenario no exception handler is installed.
Also, if a destructor leaks out an exception while another exception is in flight,
then all bets are off.
#include <iostream> using namespace std; struct Test { ~Test(){ cout << "ha" << endl; } }; void ha() { Test t; throw 0; } int main(){ try{ ha(); } catch(...){ cout << "catch!" << endl; } }
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.