diff options
author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/scope_exit.hpp | |
parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
download | swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/scope_exit.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/scope_exit.hpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/3rdParty/Boost/src/boost/scope_exit.hpp b/3rdParty/Boost/src/boost/scope_exit.hpp index de502f4..961b29c 100644 --- a/3rdParty/Boost/src/boost/scope_exit.hpp +++ b/3rdParty/Boost/src/boost/scope_exit.hpp @@ -564,71 +564,71 @@ msvc_register_type<T, Organizer> typeof_register_type(const T&, #define BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS(d, captures, this01, this_) \ (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(\ capture), \ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_THIS \ , \ BOOST_SCOPE_EXIT_AUX_TRAITS_OP_CAPTURE \ )(d, BOOST_PP_TUPLE_ELEM(2, 0, captures_this), \ BOOST_PP_TUPLE_ELEM(2, 1, captures_this), capture) // ref_val: & | = #define BOOST_SCOPE_EXIT_AUX_TRAITS_ALL_OP(ref_val, traits) \ ( \ BOOST_PP_LIST_APPEND((ref_val, BOOST_PP_NIL), \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ , \ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits) \ ) #define BOOST_SCOPE_EXIT_AUX_TRAITS(captures) \ BOOST_PP_LIST_FOLD_LEFT(BOOST_SCOPE_EXIT_AUX_TRAITS_OP, \ (BOOST_PP_NIL, 0), captures) #define BOOST_SCOPE_EXIT_AUX_TRAITS_ALL(captures) \ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL_OP(BOOST_PP_LIST_FIRST(captures), \ BOOST_SCOPE_EXIT_AUX_TRAITS(BOOST_PP_LIST_REST(captures))) #define BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits) \ BOOST_PP_TUPLE_ELEM(2, 0, traits) #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 { template<typename This = void> struct guard { // With object `this_` (for backward compatibility). explicit guard(This _this) : this_(_this) {} ~guard() { if(f_) f_(this_); } template<typename Lambda> void operator=(Lambda f) { f_ = f; } private: This this_; boost::function<void (This)> f_; }; template<> struct guard<void> { // Without object `this_` (could capture `this` directly). ~guard() { if(f_) f_(); } template<typename Lambda> void operator=(Lambda f) { f_ = f; } private: boost::function<void (void)> f_; }; } } } // namespace #define BOOST_SCOPE_EXIT_AUX_LAMBDA_PARAMS(id) \ BOOST_PP_CAT(boost_se_lambda_params_, id) #define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_CAPTURE_TYPE(id) \ BOOST_PP_CAT(boost_se_lambda_this_t_, id) #define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id) \ BOOST_PP_CAT(boost_se_lambda_this_capture_t_, id) #define BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE(id, ty) \ @@ -645,71 +645,71 @@ private: BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_PARAM_TYPE(id); \ }; #define BOOST_SCOPE_EXIT_AUX_IMPL_LAMBDA(id, ty, traits) \ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ /* no need for TYPEDEF THIS MSVC workaround on C++11 */ \ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPEDEFS \ , \ BOOST_PP_TUPLE_EAT(3) \ )(id, ty, traits) \ ::boost::scope_exit::aux::guard< \ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE \ , \ BOOST_PP_TUPLE_EAT(2) \ )(id, ty) \ > BOOST_SCOPE_EXIT_AUX_GUARD(id) \ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ (this) \ ) \ ; \ BOOST_SCOPE_EXIT_AUX_GUARD(id) = [ \ BOOST_PP_LIST_ENUM(BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ ]( \ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ BOOST_SCOPE_EXIT_AUX_LAMBDA_THIS_TYPE \ , \ BOOST_PP_TUPLE_EAT(2) \ )(id, ty) \ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), this_) \ ) mutable /* can change value captures (as with SCOPE_EXIT) */ -> void #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) #else // Not using lambdas. // ty: EMPTY() | typename #define BOOST_SCOPE_EXIT_AUX_IMPL(id, ty, traits) \ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_TAG_DECL, id, \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL, (id, ty), \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ BOOST_PP_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS \ , \ BOOST_PP_TUPLE_EAT(3) \ )(id, ty, BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id)) \ struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \ /* interim capture types to workaround internal errors on old GCC */ \ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL, (id, ty), \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ typedef BOOST_SCOPE_EXIT_AUX_THIS_CAPTURE_T(id) \ BOOST_SCOPE_EXIT_AUX_THIS_T(id) ; \ ) \ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ BOOST_SCOPE_EXIT_AUX_THIS_T(id) \ BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) ; \ ) \ BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, ty, \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits), \ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits)) \ } BOOST_SCOPE_EXIT_AUX_PARAMS(id) \ @@ -726,196 +726,196 @@ private: struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)* boost_se_params_; \ BOOST_SCOPE_EXIT_AUX_GUARD_T(id) (void* boost_se_params) \ : boost_se_params_( \ (BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)*)boost_se_params) \ {} \ ~BOOST_SCOPE_EXIT_AUX_GUARD_T(id)() { \ boost_se_body( \ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS( \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)), \ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits))) \ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS( \ traits), \ boost_se_params_->BOOST_SCOPE_EXIT_DETAIL_PARAM_THIS(id) \ ) \ ); \ } \ static void boost_se_body( \ BOOST_PP_LIST_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG_DECL, (id, ty), \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)) \ BOOST_PP_COMMA_IF(BOOST_PP_BITAND(BOOST_PP_LIST_IS_CONS( \ BOOST_SCOPE_EXIT_AUX_TRAITS_CAPTURES(traits)), \ BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits))) \ BOOST_PP_EXPR_IIF(BOOST_SCOPE_EXIT_AUX_TRAITS_HAS_THIS(traits), \ ty BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \ BOOST_SCOPE_EXIT_AUX_THIS_T(id) this_ \ ) \ ) #endif // Using lambdas. // 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))) # 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))) # define BOOST_SCOPE_EXIT(void_or_seq) \ BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_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, \ 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 */ \ /* always typename here and no need for ..._ALL_TPL */ \ /* (if a C++11 compiler does not implement this use of */ \ /* typename, always use `this` instead of `this_`) */ \ typename, \ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \ BOOST_LOCAL_FUNCTION_DETAIL_PP_NON_VOID_LIST(seq))) # define BOOST_SCOPE_EXIT_ALL(seq) \ BOOST_SCOPE_EXIT_ALL_ID( \ BOOST_LOCAL_FUNCTION_DETAIL_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__))) # 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__))) # define BOOST_SCOPE_EXIT(...) \ BOOST_SCOPE_EXIT_ID(BOOST_LOCAL_FUNCTION_DETAIL_PP_LINE_COUNTER, \ __VA_ARGS__) # define BOOST_SCOPE_EXIT_TPL(...) \ BOOST_SCOPE_EXIT_ID_TPL(BOOST_LOCAL_FUNCTION_DETAIL_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 */ \ /* always typename here and no need for ..._ALL_TPL */ \ /* (if a C++11 compiler does not implement this use of */ \ /* typename, always use `this` instead of `this_`) */ \ typename, \ BOOST_SCOPE_EXIT_AUX_TRAITS_ALL( \ BOOST_LOCAL_FUNCTION_DETAIL_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__) # 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. # define BOOST_SCOPE_EXIT_END_ID(id) \ } 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) // DOCUMENTATION // #else // DOXYGEN /** @file @brief Scope exits allow to execute arbitrary code when the enclosing scope exits. */ /** @brief This macro declares a scope exit. The scope exit declaration schedules the execution of the scope exit body at the exit of the enclosing scope: @code { // Some local scope. ... BOOST_SCOPE_EXIT(capture_list) { ... // Body code. } BOOST_SCOPE_EXIT_END ... } @endcode The enclosing scope must be local. If multiple scope exits are declared within the same enclosing scope, the scope exit bodies are executed in the reversed order of their declarations. Note how the end of the scope exit body must be marked by @RefMacro{BOOST_SCOPE_EXIT_END}. @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: void | capture_tuple | capture_sequence capture_tuple: capture\, capture\, ... capture_sequence: (capture) (capture) ... capture: [&]variable | this_ @endcode On compilers that do not support variadic macros\, <c>capture_tuple</c> cannot be used: @code capture_list: 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 capture: [&]variable | this_ | this @endcode (Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or <c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing; <c>{expression}</c> means the tokens resulting from the expression.) } @EndParams Note that on compilers that support variadic macros (most of moder compliers and all C++11 compilers), the capture list can be specified as a comma-separated list of tokens (this is the preferred syntax). However, on all compilers the same macro @RefMacro{BOOST_SCOPE_EXIT} also allows to specify the capture list as a Boost.Preprocessor sequence of tokens (for supporting compilers without variadic macros and for backward compatibility with older versions of this library). The name <c>variable</c> of each captured variable must be a valid name in the enclosing scope and it must appear exactly once in the capture list. If a capture starts with the ampersand sign <c>&</c>, the corresponding variable will be available by reference within the scope exit body; otherwise, a copy of the variable will be made at the point of the scope exit declaration and that copy will be available inside the scope exit body (in this case, the variable's type must be <c>CopyConstructible</c>). From within a member function, the object <c>this</c> can be captured using the special name <c>this_</c> in both the capture list and the scope exit body (using <c>this</c> instead of <c>this_</c> in the scope exit body leads to undefined behaviour). It is possible to capture no variable by specifying the capture list as <c>void</c> (regardless of variadic macro support). @@ -1075,78 +1075,78 @@ Same as the <c>capture_list</c> parameter of the @Note This macro can be useful when the scope exit macros are expanded within user-defined macros (because nested macros expand on the same line). On some compilers (e.g., MSVC which supports the non standard <c>__COUNTER__</c> macro) it might not be necessary to use this macro but the use of this macro is always necessary to ensure portability when expanding multiple scope exit declarations on the same line. @See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT_TPL}, @RefMacro{BOOST_SCOPE_EXIT_END_ID}, @RefMacro{BOOST_SCOPE_EXIT_ID}, @RefMacro{BOOST_SCOPE_EXIT_ALL_ID}. */ #define BOOST_SCOPE_EXIT_ID_TPL(id, capture_list) /** @brief This macro declares a scope exit that captures all variables in scope (C++11 only). This macro accepts a capture list starting with either <c>&</c> or <c>=</c> to capture all variables in scope by reference or value respectively (following the same syntax of C++11 lambdas). A part from that, this macro works like @RefMacro{BOOST_SCOPE_EXIT} (see @RefMacro{BOOST_SCOPE_EXIT} for more information): @code { // Some local scope. ... BOOST_SCOPE_EXIT_ALL(capture_list) { // C++11 only. ... // Body code. }; // Use `;` instead of `BOOST_SCOPE_EXIT_END` (C++11 only). ... } @endcode 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: capture_tuple | capture_sequence capture_tuple: {& | =} [\, capture\, capture\, ...] capture_sequence: {(&) | (=)} [(capture) (capture) ...] capture: [&]variable | this_ @endcode On compilers that do not support variadic macros\, <c>capture_tuple</c> cannot be used: @code capture_list: void | capture_sequence @endcode Furthermore\, on C++11 compilers that support the use of <c>typename</c> outside templates\, also <c>this</c> can be used to capture the object at member function scope: @code capture: [&]variable | this_ | this @endcode (Lexical conventions: <c>token1 | token2</c> means either <c>token1</c> or <c>token2</c>; <c>[token]</c> means either <c>token</c> or nothing; <c>{expression}</c> means the token resulting from the expression.) } @EndParams Note that on compilers with variadic macro support (which should be all C++11 compilers), the capture list can be specified as a comma-separated list. On all compilers, the same macro @RefMacro{BOOST_SCOPE_EXIT_ALL} also allows to specify the capture list as a Boost.Preprocessor sequence. @@ -1159,71 +1159,71 @@ In general, the special macro @RefMacro{BOOST_SCOPE_EXIT_ALL_ID} must be used instead of @RefMacro{BOOST_SCOPE_EXIT_ALL} when it is necessary to expand multiple scope exit declarations on the same line. @Warning This macro capture list follows the exact same syntax of C++11 lambda captures which is unfortunately different from the syntax of @RefMacro{BOOST_SCOPE_EXIT} captures (unless programmers define the @RefMacro{BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS} macro). For example, like C++11 lambda functions, @RefMacro{BOOST_SCOPE_EXIT_ALL} requires to capture data members by capturing the object <c>this</c> while @RefMacro{BOOST_SCOPE_EXIT} allows to capture data members directly and without capturing the object. @Warning The implementation executes the scope exit body within a destructor thus the scope exit body must never throw in order to comply with STL exception safety requirements. @Note This macro can always be used also within templates (so there is no need for a <c>BOOST_SCOPE_EXIT_ALL_TPL</c> macro). @See @RefSect{tutorial, Tutorial} section, @RefSect{no_variadic_macros, No Variadic Macros} section, @RefMacro{BOOST_SCOPE_EXIT}, @RefMacro{BOOST_SCOPE_EXIT_ALL_ID}. */ #define BOOST_SCOPE_EXIT_ALL(capture_list) /** @brief This macro allows to expand on the same line multiple scope exits that capture all variables in scope (C++11 only). This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_ALL} but it can be expanded multiple times on the same line if different identifiers <c>id</c> are 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, A unique identifier token which can be concatenated by the preprocessor (<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of alphanumeric tokens\, etc). } @Param{capture_list, Same as the <c>capture_list</c> parameter of the @RefMacro{BOOST_SCOPE_EXIT_ALL} macro. } @EndParams @Note This macro can be useful when the scope exit macros are expanded within user-defined macros (because nested macros expand on the same line). On some compilers (e.g., MSVC which supports the non standard <c>__COUNTER__</c> macro) it might not be necessary to use this macro but the use of this macro is always necessary to ensure portability when expanding multiple scope exit declarations on the same line. @See @RefSect{tutorial, Tutorial} section, @RefMacro{BOOST_SCOPE_EXIT_ALL}, @RefMacro{BOOST_SCOPE_EXIT_ID}. */ #define BOOST_SCOPE_EXIT_ALL_ID(id, capture_list) /** @brief This macro marks the end of a scope exit body. This macro must follow the closing curly bracket <c>}</c> that ends the body of either @RefMacro{BOOST_SCOPE_EXIT} or @RefMacro{BOOST_SCOPE_EXIT_TPL}: @code { // Some local scope. ... BOOST_SCOPE_EXIT(capture_list) { @@ -1250,67 +1250,67 @@ However, to maximize portability, it is recommended to always use /** @brief This macro allows to terminate multiple scope exit bodies on the same line. This macro is equivalent to @RefMacro{BOOST_SCOPE_EXIT_END} but it can be expanded multiple times on the same line if different identifiers <c>id</c> are provided for each expansion (see @RefMacro{BOOST_SCOPE_EXIT_END} for more information). @Params @Param{id, A unique identifier token which can be concatenated by the preprocessor (<c>__LINE__</c>\, <c>scope_exit_number_1_on_line_123</c>\, a combination of alphanumeric tokens\, etc). } @EndParams @Note This macro can be useful when the scope exit macros are expanded within user-defined macros (because macros all expand on the same line). On some compilers (e.g., MSVC which supports the non standard <c>__COUNTER__</c> macro) it might not be necessary to use this macro but the use of this macro is always necessary to ensure portability when expanding multiple scope exit macros on the same line (because this library can only portably use <c>__LINE__</c> to internally generate unique identifiers). @See @RefMacro{BOOST_SCOPE_EXIT_ID}, @RefMacro{BOOST_SCOPE_EXIT_ID_TPL}, @RefMacro{BOOST_SCOPE_EXIT_END}. */ #define BOOST_SCOPE_EXIT_END_ID(id) /** @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. @Warning When scope exits are implemented using lambda functions, the syntax of the capture list follows the exact same syntax of C++11 lambda captures which is in general different from the legacy capture syntax of this library. For example, C++11 lambdas require to capture data members by capturing the object <c>this</c> while this library always allowed to capture data members directly. Therefore, when this configuration macro is defined, @RefMacro{BOOST_SCOPE_EXIT} and @RefMacro{BOOST_SCOPE_EXIT_TPL} are no longer backward compatible (and this is why this macro is not defined by default). A semicolon <c>;</c> can be used instead of @RefMacro{BOOST_SCOPE_EXIT_END} when this configuration macro is defined (but it is recommended to always use @RefMacro{BOOST_SCOPE_EXIT_END} so to maximize portability). @Note This configuration macro does not control the definition of @RefMacro{BOOST_SCOPE_EXIT_ALL} which is always and automatically defined on compilers that support C++11 lambda functions. @See @RefMacro{BOOST_SCOPE_EXIT}, @RefMacro{BOOST_SCOPE_EXIT_TPL}, @RefMacro{BOOST_SCOPE_EXIT_END}. */ #define BOOST_SCOPE_EXIT_CONFIG_USE_LAMBDAS #endif // DOXYGEN #endif // #ifndef FILE_boost_scope_exit_hpp_INCLUDED |