Basically I've got a function with a scope guard to do cleanup on exit.
And then a problem happens in the scope guard cleanup and it throws.
string f(void)
{
scope_guard x(){ throw std::runtime_error("Failed to finalize stmt.");}
return "ok";
}
So as I watch in my debugger, the return starts to happen, the scope guard goes out of scope and inside that, it throws.
msvc2017 gave me an unhandled exception exception or something like that.
I would think this should work unless there's something unpleasant about throwing in the middle of the stack unwind or something like that?
Any ideas?