Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Macro BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL

BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL — Force to use C++11 lambda implementation for scope-exit macro.

Synopsis

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

BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDA_IMPL

Description

If programmers define this configuration macro on a C++11 compiler, lambda functions will be used to implement the BOOST_SCOPE_EXIT macro. By default this macro is not defined.

Note: When BOOST_SCOPE_EXIT is implemented using lambda, the semantics of its variable captures follow the semantics of C++11 lambda captures which are in general different from the legacy capture semantics of this library (e.g., C++11 lambdas require to capture data members via capturing the object this while this library always allowed to capture data members directly). Therefore, when this configuration macro is defined, BOOST_SCOPE_EXIT is no longer backward compatible.

A semicolon ; can simply be used instead of BOOST_SCOPE_EXIT_END when this configuration macro is defined.

This configuration macro does not control the definition of BOOST_SCOPE_EXIT_ALL which is always and automatically defined on compilers that support C++11 lambdas.

See: BOOST_SCOPE_EXIT, BOOST_SCOPE_EXIT_ALL, BOOST_SCOPE_EXIT_END.


PrevUpHomeNext