...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Scope exits allow to execute arbitrary code when the enclosing scope exits.
BOOST_SCOPE_EXIT(capture_list) BOOST_SCOPE_EXIT_TPL(capture_list) BOOST_SCOPE_EXIT_ID(id, capture_list) BOOST_SCOPE_EXIT_TPL_ID(id, capture_list) BOOST_SCOPE_EXIT_ALL(capture_list) BOOST_SCOPE_EXIT_ALL_ID(id, capture_list) BOOST_SCOPE_EXIT_END BOOST_SCOPE_EXIT_END_ID(id) BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS