On Thu, Sep 26, 2013 at 5:58 AM, Sergey Cheban
On 02.10.2012 16:53, Evgeny Panasyuk wrote:
Currently BOOST_SCOPE_FAILURE and BOOST_SCOPE_SUCCESS are implemented based on boost_1_51_0/boost/scope_exit.hpp by copy-paste and replace (just for proof-or-concept, of course it is possible solution with much less duplication). Semantically meaningful changes can be viewed as diff at
https://github.com/panaseleus/stack_unwinding/commit/d5513404323490ea99d9b6b...
Any progress on this?
As far as I understand it, this cannot be implemented (at least in a portable way). See: http://www.boost.org/doc/libs/1_54_0/libs/scope_exit/doc/html/scope_exit/alt... Boost.ScopeExit is similar to scope(exit) feature built into the D programming language. A curious reader may notice that the library does not implement scope(success) and scope(failure) of the D language. Unfortunately, these are not possible in C++ because failure or success conditions cannot be determined by callingstd::uncaught_exception (see Guru of the Week #47 for details about std::uncaught_exception and if it has any good use at all). However, this is not a big problem because these two D's constructs can be expressed in terms of scope(exit) and a boolcommit variable (similarly to some examples presented in the Tutorial section). HTH, --Lorenzo