Re:Get to No as fast as possible
by albertzeyer on Thursday June 17, 2010 @01:46PM
(#1439720)
I'm always using this style because of much better readability.
If I need some shared cleanup code when the function returns, I'm using some of the C++ scope-exit trick. Or in most cases, some of the predefined scope-exit handlers do just what I want. Like:
std::auto_ptr or boost::scoped_ptr
boost::shared_ptr
boost::interprocess::scoped_lock (or I have my own mutex scopedlock class)
If I need some shared cleanup code when the function returns, I'm using some of the C++ scope-exit trick. Or in most cases, some of the predefined scope-exit handlers do just what I want. Like: