Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Macro BOOST_SCOPE_EXIT_END

BOOST_SCOPE_EXIT_END — This macro marks the end of a scope exit body.

Synopsis

// In header: <boost/scope_exit.hpp>

BOOST_SCOPE_EXIT_END

Description

This macro must follow the closing curly bracket } that ends the body of either BOOST_SCOPE_EXIT or BOOST_SCOPE_EXIT_TPL:

    { // Some local scope.
        ...
        BOOST_SCOPE_EXIT(capture_list) {
            ... // Body code.
        } BOOST_SCOPE_EXIT_END
        ...
    }

In general, the special macro BOOST_SCOPE_EXIT_END_ID must be used instead of BOOST_SCOPE_EXIT_END when it is necessary to expand multiple scope exit bodies on the same line.

Note: If programmers define the BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS macro on C++11 compilers, a semicolon ; can be used instead of this macro. However, to maximize portability, it is recommended to always use BOOST_SCOPE_EXIT_END.

See: Tutorial section, BOOST_SCOPE_EXIT, BOOST_SCOPE_EXIT_TPL, BOOST_SCOPE_EXIT_END_ID.


PrevUpHomeNext