Reputation: 132300
I recently watched Andrei Alexandrescu's talk in 'C++ and Beyond 2012' (Systematic Error Handling with C++), in which he discusses his ScopeGuard11 construct, and specifically SCOPE_EXIT
(second part of the talk; or just read the code here). At the same time, I'm beginning to look into the Boost library, and have noticed the BOOST_SCOPE_EXIT
macro (the Boost.ScopeExit library).
These two seem to be quite different implementation-wise (BOOST_SCOPE_EXIT
uses Boost.TypeOf
, nothing like that in ScopeGuard11's SCOPE_EXIT
); and the Boost macro is concerned with parameter capture etc. which is less of an issue in C++11; but beyond that, they seem to offer essentially the same functionality.
Am I right or am I missing something? Could one say that ScopeGuard11 is a 'cleaner' mechanism with the same functionality of Boost.ScopeGuard but with less backwards compatibility?
Upvotes: 3
Views: 1049