C++ force stack unwinding inside function
问题 I'm in the process of learning C++ and currently I'm fiddling with the following code: class Bar; struct Callback { virtual void Continue(Bar&) = 0; }; // ... void Foo(Bar& _x, Callback& result) { // Do stuff with _x if(/* some condition */) { // TODO: Force unwind of stack result.Continue(_x); return; } // Do more stuff with _x if(/* some other condition */) { // TODO: Force unwind of stack result.Continue(_x); return; } // TODO: Force unwind of stack Bar y; // allocate something on the