diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
commit | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch) | |
tree | 7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/scope_exit.hpp | |
parent | bb4dd8289b351fae6b55e303f189127a394a1edd (diff) | |
download | boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2 boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip |
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/scope_exit.hpp')
-rw-r--r-- | boost/scope_exit.hpp | 203 |
1 files changed, 151 insertions, 52 deletions
diff --git a/boost/scope_exit.hpp b/boost/scope_exit.hpp index de502f4444..b834e55a42 100644 --- a/boost/scope_exit.hpp +++ b/boost/scope_exit.hpp @@ -11,9 +11,6 @@ #ifndef DOXYGEN -#include <boost/local_function/detail/preprocessor/line_counter.hpp> -#include <boost/local_function/detail/preprocessor/void_list.hpp> -#include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp> #include <boost/detail/workaround.hpp> #include <boost/mpl/assert.hpp> #include <boost/mpl/int.hpp> @@ -24,6 +21,7 @@ #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/control/iif.hpp> #include <boost/preprocessor/control/expr_iif.hpp> +#include <boost/preprocessor/comparison/equal.hpp> #include <boost/preprocessor/logical/bitor.hpp> #include <boost/preprocessor/logical/bitand.hpp> #include <boost/preprocessor/facilities/empty.hpp> @@ -32,13 +30,17 @@ #include <boost/preprocessor/punctuation/comma_if.hpp> #include <boost/preprocessor/punctuation/paren_if.hpp> #include <boost/preprocessor/seq/cat.hpp> +#include <boost/preprocessor/seq/size.hpp> +#include <boost/preprocessor/seq/to_tuple.hpp> #include <boost/preprocessor/tuple/elem.hpp> #include <boost/preprocessor/tuple/eat.hpp> +#include <boost/preprocessor/tuple/to_list.hpp> #include <boost/preprocessor/list/append.hpp> #include <boost/preprocessor/list/fold_left.hpp> #include <boost/preprocessor/list/enum.hpp> #include <boost/preprocessor/list/adt.hpp> #include <boost/preprocessor/list/for_each_i.hpp> +#include <boost/preprocessor/detail/is_unary.hpp> // PRIVATE/PROTECTED // @@ -65,6 +67,123 @@ # define BOOST_SCOPE_EXIT_AUX_TYPEOF_THIS_MSVC_WORKAROUND_01 0 #endif +// MSVC has problems expanding __LINE__ so use (the non standard) __COUNTER__. +#ifdef BOOST_MSVC +# define BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER __COUNTER__ +#else +# define BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER __LINE__ +#endif + +// Preprocessor "keyword" detection. + +// These are not a local macros, do not #undefine them (these are used by the +// ..._BACK macros below). +#define this_BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_THISUNDERSCORE_IS (1) /* unary */ +#define void_BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_VOID_IS (1) /* unary */ + +#define BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_BACK_(token, checking_postfix) \ + BOOST_PP_IS_UNARY(BOOST_PP_CAT(token, checking_postfix)) + +#define BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_THISUNDERSCORE_BACK(token) \ + BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_BACK_(token, \ + BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_THISUNDERSCORE_IS) + +#define BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_VOID_BACK(token) \ + BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_BACK_(token, \ + _BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_VOID_IS) + +// Preprocessor "void-list". + +// NOTE: Empty list must always be represented as void (which is also a way to +// specify no function parameter) and it can never be empty because (1) +// IS_EMPTY(&var) fails (because of the leading non alphanumeric symbol) and +// (2) some compilers (MSVC) fail to correctly pass empty macro parameters +// even if they support variadic macros. Therefore, always using void to +// represent is more portable. + +// Argument: (token1)... +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_FROM_SEQ_(unused, seq) \ + BOOST_PP_TUPLE_TO_LIST(BOOST_PP_SEQ_SIZE(seq), BOOST_PP_SEQ_TO_TUPLE(seq)) + +// Token: void | token1 +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_HANDLE_VOID_( \ + is_void_macro, token) \ + BOOST_PP_IIF(is_void_macro(token), \ + BOOST_PP_NIL \ + , \ + (token, BOOST_PP_NIL) \ + ) + +// Token: (a)(b)... | empty | void | token +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_HANDLE_SEQ_( \ + is_void_macro, token) \ + BOOST_PP_IIF(BOOST_PP_IS_UNARY(token), /* unary paren (a)... */ \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_FROM_SEQ_ \ + , \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_HANDLE_VOID_ \ + )(is_void_macro, token) + +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_NEVER_(tokens) \ + 0 /* void check always returns false */ + +#ifdef BOOST_NO_CXX11_VARIADIC_MACROS + +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_(is_void_macro, seq) \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_HANDLE_SEQ_(is_void_macro, seq) + +// Expand `void | (a)(b)...` to pp-list `NIL | (a, (b, NIL))`. +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST(sign) \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_( \ + BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_VOID_BACK, sign) + +// Expand `(a)(b)...` to pp-list `(a, (b, NIL))`. +#define BOOST_SCOPE_EXIT_AUX_PP_NON_VOID_LIST(seq) \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_( \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_NEVER_, seq) + +#else // VARIADICS + +// FUTURE: Replace this with BOOST_PP_VARIADIC_SIZE when and if +// BOOST_PP_VARIAIDCS detection will match !BOOST_NO_CXX11_VARIADIC_MACROS (for +// now Boost.Preprocessor and Boost.Config disagree on detecting compiler +// variadic support while this VARIADIC_SIZE works on compilers not detected by +// PP). +#if BOOST_MSVC +# define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_(...) \ + BOOST_PP_CAT(BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_I_(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,),) +#else // MSVC +# define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_(...) \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_I_(__VA_ARGS__, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,) +#endif // MSVC +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_I_(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, size, ...) size + +// Argument: token1, ... +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_FROM_VARIADIC_(unused, ...) \ + BOOST_PP_TUPLE_TO_LIST( \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_( \ + __VA_ARGS__), (__VA_ARGS__)) + +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_(is_void_macro, ...) \ + BOOST_PP_IIF(BOOST_PP_EQUAL( \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_VARIADIC_SIZE_( \ + __VA_ARGS__), 1), \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_HANDLE_SEQ_ \ + , \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_FROM_VARIADIC_ \ + )(is_void_macro, __VA_ARGS__) + +// Expand `void | (a)(b)... | a, b, ...` to pp-list `NIL | (a, (b, NIL))`. +#define BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST(...) \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_( \ + BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_VOID_BACK, __VA_ARGS__) + +// Expand `(a)(b)... | a, b, ...` to pp-list `(a, (b, NIL))`. +#define BOOST_SCOPE_EXIT_AUX_PP_NON_VOID_LIST(...) \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_( \ + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST_NEVER_, __VA_ARGS__) + +#endif // VARIADICS + // Steven Watanabe's trick with a modification suggested by Kim Barrett namespace boost { namespace scope_exit { namespace detail { @@ -222,7 +341,7 @@ extern boost::scope_exit::detail::undeclared BOOST_SCOPE_EXIT_AUX_ARGS; #include <boost/type_traits/is_function.hpp> #include <boost/utility/enable_if.hpp> -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) +#if defined(BOOST_MSVC) # include <typeinfo> #endif @@ -230,7 +349,7 @@ namespace boost { namespace scope_exit { namespace aux { namespace msvc_typeof_this { // compile-time constant code -#if BOOST_WORKAROUND(BOOST_MSVC, >=1300) && defined(_MSC_EXTENSIONS) +#if defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS) template<int N> struct the_counter; @@ -278,27 +397,7 @@ template<> struct encode_counter<0> {}; #endif // compile-time constant code -#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) // type-of code - -template<typename ID> -struct msvc_extract_type -{ - template<bool> - struct id2type_impl; - - typedef id2type_impl<true> id2type; -}; - -template<typename T, typename ID> -struct msvc_register_type : msvc_extract_type<ID> -{ - template<> - struct id2type_impl<true> { // VC7.0 specific bug-feature. - typedef T type; - }; -}; - -#elif BOOST_WORKAROUND(BOOST_MSVC, >= 1400) // type-of code +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) // type-of code struct msvc_extract_type_default_param {}; @@ -565,7 +664,7 @@ msvc_register_type<T, Organizer> typeof_register_type(const T&, (captures, 1 /* has this (note, no error if multiple this_) */) #define BOOST_SCOPE_EXIT_AUX_TRAITS_OP(d, captures_this, capture) \ - BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK(\ + BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_PP_KEYWORD_IS_THISUNDERSCORE_BACK(\ capture), \ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS \ , \ @@ -596,7 +695,7 @@ msvc_register_type<T, Organizer> typeof_register_type(const T&, #define BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits) \ BOOST_PP_TUPLE_ELEM(2, 1, traits) -#ifndef BOOST_NO_LAMBDAS +#ifndef BOOST_NO_CXX11_LAMBDAS namespace boost { namespace scope_exit { namespace aux { @@ -677,7 +776,7 @@ private: #endif // Lambdas. #if defined(BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS) && \ - !defined(BOOST_NO_LAMBDAS) // Use lambda for SCOPE_EXIT (not just _ALL). + !defined(BOOST_NO_CXX11_LAMBDAS) // Use lambda for SCOPE_EXIT (not just _ALL). #define BOOST_SCOPE_EXIT_AUX_IMPL(id, ty, traits) \ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, ty, traits) @@ -758,22 +857,22 @@ private: // PUBLIC // -#if defined(BOOST_NO_VARIADIC_MACROS) // No variadic macros (sequences only). +#if defined(BOOST_NO_CXX11_VARIADIC_MACROS) // No variadic macros (sequences only). # define BOOST_SCOPE_EXIT_ID(id, void_or_seq) \ BOOST_SCOPE_EXIT_AUX_IMPL(id, BOOST_PP_EMPTY(), \ BOOST_SCOPE_EXIT_AUX_TRAITS( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(void_or_seq))) + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST(void_or_seq))) # define BOOST_SCOPE_EXIT_ID_TPL(id, void_or_seq) \ BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \ BOOST_SCOPE_EXIT_AUX_TRAITS( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(void_or_seq))) + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST(void_or_seq))) # define BOOST_SCOPE_EXIT(void_or_seq) \ - BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \ + BOOST_SCOPE_EXIT_ID(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, \ void_or_seq) # define BOOST_SCOPE_EXIT_TPL(void_or_seq) \ - BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \ + BOOST_SCOPE_EXIT_ID_TPL(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, \ void_or_seq) -# if !defined(BOOST_NO_LAMBDAS) +# if !defined(BOOST_NO_CXX11_LAMBDAS) # define BOOST_SCOPE_EXIT_ALL_ID(id, seq) \ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, \ /* C++11 allows to use typename outside templates so */ \ @@ -782,27 +881,27 @@ private: /* typename, always use `this` instead of `this_`) */ \ typename, \ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST(seq))) + BOOST_SCOPE_EXIT_AUX_PP_NON_VOID_LIST(seq))) # define BOOST_SCOPE_EXIT_ALL(seq) \ BOOST_SCOPE_EXIT_ALL_ID( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, seq) + BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, seq) # endif #else // Variadic macros (both sequences and variadic tuples). # define BOOST_SCOPE_EXIT_ID(id, ...) \ BOOST_SCOPE_EXIT_AUX_IMPL(id, BOOST_PP_EMPTY(), \ BOOST_SCOPE_EXIT_AUX_TRAITS( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__))) + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST(__VA_ARGS__))) # define BOOST_SCOPE_EXIT_ID_TPL(id, ...) \ BOOST_SCOPE_EXIT_AUX_IMPL(id, typename, \ BOOST_SCOPE_EXIT_AUX_TRAITS( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_VOID_LIST(__VA_ARGS__))) + BOOST_SCOPE_EXIT_AUX_PP_VOID_LIST(__VA_ARGS__))) # define BOOST_SCOPE_EXIT(...) \ - BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \ + BOOST_SCOPE_EXIT_ID(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, \ __VA_ARGS__) # define BOOST_SCOPE_EXIT_TPL(...) \ - BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \ + BOOST_SCOPE_EXIT_ID_TPL(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, \ __VA_ARGS__) -# if !defined(BOOST_NO_LAMBDAS) +# if !defined(BOOST_NO_CXX11_LAMBDAS) # define BOOST_SCOPE_EXIT_ALL_ID(id, ...) \ BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, \ /* C++11 allows to use typename outside templates so */ \ @@ -811,16 +910,16 @@ private: /* typename, always use `this` instead of `this_`) */ \ typename, \ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST( \ + BOOST_SCOPE_EXIT_AUX_PP_NON_VOID_LIST( \ __VA_ARGS__))) # define BOOST_SCOPE_EXIT_ALL(...) \ BOOST_SCOPE_EXIT_ALL_ID( \ - BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, __VA_ARGS__) + BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER, __VA_ARGS__) # endif #endif // Variadics. #if defined(BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS) && \ - !defined(BOOST_NO_LAMBDAS) // Use lambdas for SCOPE_EXIT (not just ALL). + !defined(BOOST_NO_CXX11_LAMBDAS) // Use lambdas for SCOPE_EXIT (not just ALL). # define BOOST_SCOPE_EXIT_END_ID(id) \ ; /* lambdas ended with just `;` */ #else // Not using lambdas. @@ -828,7 +927,7 @@ private: } BOOST_SCOPE_EXIT_AUX_GUARD(id)(BOOST_SCOPE_EXIT_AUX_ARGS.value); #endif // Using lambdas. #define BOOST_SCOPE_EXIT_END \ - BOOST_SCOPE_EXIT_END_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER) + BOOST_SCOPE_EXIT_END_ID(BOOST_SCOPE_EXIT_AUX_PP_LINE_COUNTER) // DOCUMENTATION // @@ -864,7 +963,7 @@ Note how the end of the scope exit body must be marked by @Params @Param{capture_list, On compilers that support variadic macros (see also Boost.Config -<c>BOOST_NO_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the +<c>BOOST_NO_CXX11_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the following grammar: @code capture_list: @@ -883,7 +982,7 @@ be used: void | capture_sequence @endcode Furthermore\, if @RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS} is defined on -C++11 compilers that support lambda functions (i.e.\, Boost.Config's <c>BOOST_NO_LAMBDAS</c> is not defined) then a semicolon <c>;</c> can be used instead of +C++11 compilers that support lambda functions (i.e.\, Boost.Config's <c>BOOST_NO_CXX11_LAMBDAS</c> is not defined) then a semicolon <c>;</c> can be used instead of @RefMacro{BOOST_SCOPE_EXIT_END} and <c>this</c> can be used instead of <c>this_</c>: @code @@ -1107,14 +1206,14 @@ Note how the end of the scope exit body declared by this macro must be marked by a semi-column <c>;</c> (and not by @RefMacro{BOOST_SCOPE_EXIT_END}). @Warning This macro is only available on C++11 compilers (specifically, on -C++11 compilers that do not define the Boost.Config <c>BOOST_NO_LAMBDAS</c> +C++11 compilers that do not define the Boost.Config <c>BOOST_NO_CXX11_LAMBDAS</c> macro). It is not defined on non-C++11 compilers so its use on non-C++11 compilers will generate a compiler error. @Params @Param{capture_list, On compilers that support variadic macros (see also Boost.Config -<c>BOOST_NO_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the +<c>BOOST_NO_CXX11_VARIADIC_MACROS</c>)\, the capture list syntax is defined by the following grammar: @code capture_list: @@ -1191,7 +1290,7 @@ provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_ALL} for more information). As with @RefMacro{BOOST_SCOPE_EXIT_ALL}, this macro is only available on C++11 compilers (specifically, on C++11 compilers that do not define the -Boost.Config <c>BOOST_NO_LAMBDAS</c> macro). +Boost.Config <c>BOOST_NO_CXX11_LAMBDAS</c> macro). @Params @Param{id, @@ -1282,7 +1381,7 @@ portably use <c>__LINE__</c> to internally generate unique identifiers). @brief Force to use C++11 lambda functions to implement scope exits. If programmers define this configuration macro on a C++11 compiler for which -the Boost.Config macro <c>BOOST_NO_LAMBDAS</c> is not defined, the +the Boost.Config macro <c>BOOST_NO_CXX11_LAMBDAS</c> is not defined, the @RefMacro{BOOST_SCOPE_EXIT} and @RefMacro{BOOST_SCOPE_EXIT_TPL} macros will use C++11 lambda functions to declare scope exits. By default this macro is not defined. |