
Zitat von "Stewart, Robert" <Robert.Stewart@sig.com>:
control ctrl; while(true){ try{ transaction tx; commit_on_destruction destr(tx); try{ do{ ctrl=break_;
//...user code if(something) break; else if(something_else) continue; else return 5; //...end user code
ctrl=none; break; }while((ctrl=continue_),false); }catch(...){ destr.nullify(); throw; } break; }catch(isolation_exception &){} }; if(ctrl==continue_) continue; else if(ctrl==break_) break;
Couldn't you avoid the inner try block by detecting a pending exception in ~commit_on_destruction()?
because of how std::uncaught_exception() works that would fail if the macros are used inside a destructor that is called during exception unwinding: http://www.gotw.ca/gotw/047.htm