|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76376 - in sandbox/closure/boost: . closure closure/aux_ closure/aux_/macro closure/aux_/macro/code_ closure/aux_/preprocessor/traits/decl_sign_ closure/aux_/preprocessor/variadic closure/detail/preprocessor/variadic
From: lorcaminiti_at_[hidden]
Date: 2012-01-08 19:23:58
Author: lcaminiti
Date: 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
New Revision: 76376
URL: http://svn.boost.org/trac/boost/changeset/76376
Log:
Marked scope_exit with DETAIL/detail.
Added:
sandbox/closure/boost/closure/detail/preprocessor/variadic/
- copied from r76071, /sandbox/closure/boost/closure/aux_/preprocessor/variadic/
Removed:
sandbox/closure/boost/closure/aux_/preprocessor/variadic/
Text files modified:
sandbox/closure/boost/closure.hpp | 5
sandbox/closure/boost/closure/aux_/function.hpp | 16 +
sandbox/closure/boost/closure/aux_/macro/closure.hpp | 5
sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp | 30 +--
sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp | 17 -
sandbox/closure/boost/closure/aux_/macro/code_/result.hpp | 4
sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp | 2
sandbox/closure/boost/closure/config.hpp | 2
sandbox/closure/boost/closure/detail/preprocessor/variadic/is.hpp | 30 ++--
sandbox/closure/boost/closure/detail/preprocessor/variadic/size.hpp | 18 +-
sandbox/closure/boost/closure/detail/preprocessor/variadic/to_seq.hpp | 16 +-
sandbox/closure/boost/scope_exit.hpp | 291 ++++++++++++++++++++-------------------
12 files changed, 224 insertions(+), 212 deletions(-)
Modified: sandbox/closure/boost/closure.hpp
==============================================================================
--- sandbox/closure/boost/closure.hpp (original)
+++ sandbox/closure/boost/closure.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -155,10 +155,10 @@
#else // BOOST_NO_VARIADIC_MACROS
-#include <boost/closure/aux_/preprocessor/variadic/to_seq.hpp>
+#include <boost/closure/detail/preprocessor/variadic/to_seq.hpp>
#define BOOST_CLOSURE_(id, is_template, ...) \
- BOOST_CLOSURE_AUX_CLOSURE(BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ( \
+ BOOST_CLOSURE_AUX_CLOSURE(BOOST_CLOSURE_DETAIL_PP_VARIADIC_TO_SEQ( \
(void) /* for empty seq */, __VA_ARGS__), \
id, is_template)
@@ -227,7 +227,6 @@
#define BOOST_CLOSURE_END(name) \
BOOST_CLOSURE_AUX_CLOSURE_END(name)
-/** @todo make this accept this_ and error on this */
// Bound variable name. Expand to qualified bound type (i.e., bound variable
// type with extra const and/or & for const and/or reference binds).
// Can be used with local functions, blocks, and exits. It accepts `this`.
Modified: sandbox/closure/boost/closure/aux_/function.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/function.hpp (original)
+++ sandbox/closure/boost/closure/aux_/function.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -177,17 +177,27 @@
}}} // namespace boost::loca::aux
-/** @todo undef all local macros */
#undef BOOST_CLOSURE_AUX_arg_type
+#undef BOOST_CLOSURE_AUX_arg_typedef
+#undef BOOST_CLOSURE_AUX_comma_arg_tparam
#undef BOOST_CLOSURE_AUX_arg_param_type
#undef BOOST_CLOSURE_AUX_arg_name
#undef BOOST_CLOSURE_AUX_arg_param_decl
-#undef BOOST_CLOSURE_AUX_comma_arg_tparam
+#undef BOOST_CLOSURE_AUX_bind_type
+#undef BOOST_CLOSURE_AUX_comma_bind_type
+#undef BOOST_CLOSURE_AUX_comma_bind_ref
+#undef BOOST_CLOSURE_AUX_comma_bind_tparam
+#undef BOOST_CLOSURE_AUX_bind_name
+#undef BOOST_CLOSURE_AUX_comma_bind_param_decl
+#undef BOOST_CLOSURE_AUX_bind_member
+#undef BOOST_CLOSURE_AUX_comma_bind_member_deref
+#undef BOOST_CLOSURE_AUX_bind_member_init
+#undef BOOST_CLOSURE_AUX_bind_member_decl
#undef BOOST_CLOSURE_AUX_call_ptr
#undef BOOST_CLOSURE_AUX_call_name
#undef BOOST_CLOSURE_AUX_call_member
#undef BOOST_CLOSURE_AUX_call_typedef
-#undef BOOST_CLOSURE_AUX_call_param
+#undef BOOST_CLOSURE_AUX_comma_call_param_decl
#undef BOOST_CLOSURE_AUX_call_decl
#undef BOOST_CLOSURE_AUX_call_init
#undef BOOST_CLOSURE_AUX_operator_call
Modified: sandbox/closure/boost/closure/aux_/macro/closure.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/closure.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/closure.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -7,13 +7,12 @@
#ifndef BOOST_CLOSURE_AUX_CLOSURE_HPP_
#define BOOST_CLOSURE_AUX_CLOSURE_HPP_
-/** @todo uncomment these includes */
#include <boost/closure/aux_/macro/code_/result.hpp>
#include <boost/closure/aux_/macro/code_/bind.hpp>
#include <boost/closure/aux_/macro/code_/functor.hpp>
#include <boost/closure/aux_/preprocessor/traits/decl.hpp>
#include <boost/closure/aux_/preprocessor/traits/decl_error.hpp>
-//#include <boost/scope_exit.hpp>
+#include <boost/scope_exit.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/facilities/is_empty.hpp>
@@ -58,7 +57,7 @@
// Undefine local function bound args global variable. Actual declaration of
// this variable is made using SFINAE mechanisms by each local function macro.
-extern boost::scope_exit::aux::undeclared BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR;
+extern boost::scope_exit::detail::undeclared BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR;
#define BOOST_CLOSURE_AUX_CLOSURE(decl_seq, id, typename01) \
BOOST_CLOSURE_AUX_CLOSURE_(BOOST_CLOSURE_AUX_PP_DECL_TRAITS(decl_seq), \
Modified: sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -34,10 +34,9 @@
BOOST_CLOSURE_AUX_SYMBOL( (params)(id) )
#define BOOST_CLOSURE_AUX_CODE_BIND_TAG_DECL_(r, id, i, bind_traits) \
- BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, \
+ BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(r, id, i, \
BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
-// Adapted from `BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL()` (not for `this`).
#define BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_TYPED_( \
r, id, typename01, i, bind_traits) \
typedef BOOST_PP_EXPR_IIF(typename01, typename) \
@@ -50,14 +49,14 @@
bind_traits) ) \
>::arg1_type \
>::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(id, i, \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, i, \
BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
bind_traits)) \
; /* close typedef */
#define BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_DEDUCED_( \
r, id, typename01, i, bind_traits) \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, \
( \
id \
, \
@@ -82,7 +81,7 @@
#define BOOST_CLOSURE_AUX_CODE_BIND_PARAM_DECL_( \
r, id_typename, i, bind_traits) \
- BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL(r, \
( \
BOOST_PP_TUPLE_ELEM(2, 0, id_typename) \
, \
@@ -99,12 +98,12 @@
r, id, typename01, i, var) \
BOOST_PP_EXPR_IIF(typename01, typename) \
BOOST_IDENTITY_TYPE(( /* must use IDENTITY because of tparam comma */ \
- ::boost::scope_exit::aux::member< \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id, i, var) \
- , BOOST_SCOPE_EXIT_AUX_TAG(id, i) \
+ ::boost::scope_exit::detail::member< \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) \
+ , BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
> \
)) \
- BOOST_SCOPE_EXIT_AUX_PARAM(id, i, var);
+ BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var);
#define BOOST_CLOSURE_AUX_CODE_BIND_MEMBER_DECL_( \
r, id_typename, i, bind_traits) \
@@ -114,12 +113,12 @@
i, BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
#define BOOST_CLOSURE_AUX_CODE_BIND_PARAM_INIT_(r, id, i, bind_traits) \
- BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, \
BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_( \
id, all_bind_this_types) \
- BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS( \
+ BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS( \
BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id))
#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_(all_bind_this_types) \
@@ -140,7 +139,6 @@
BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_ \
)(id, all_bind_this_types)
-// Adapted from `BOOST_SCOPE_EXIT_AUX_IMPL()`.
#define BOOST_CLOSURE_AUX_CODE_BIND_ALL_( \
all_binds, all_bind_this_types, id, typename01) \
/* binding tags */ \
@@ -154,7 +152,7 @@
BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_, \
(id, typename01), all_binds) \
/* binding class */ \
- struct BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) { \
+ struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \
BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
BOOST_CLOSURE_AUX_CODE_BIND_THIS_VAR; \
@@ -213,10 +211,10 @@
/* this code takes advantage of the template argument list/comparison */ \
/* operator ambiguity to declare a variable iff it hasn't already been */ \
/* declared in that scope; the second occurrence is parsed as: */ \
- /* (boost::scope_exit::aux::declared<(boost::scope_exit::aux::resolve< */ \
- /* sizeof(boost_local_auxXargs)>::cmp1 < 0)>::cmp2 > ...Xargs); */ \
+ /* (declared<(resolve<sizeof(boost_local_auxXargs)>::cmp1<0)>::cmp2> */ \
+ /* ...Xargs); */ \
/* which is a no-op */ \
- ::boost::scope_exit::aux::declared< boost::scope_exit::aux::resolve< \
+ ::boost::scope_exit::detail::declared< boost::scope_exit::detail::resolve< \
/* cannot prefix with `::` as in `sizeof(:: ...` because the name */ \
/* must refer to the local variable name to allow multiple local */ \
/* functions (and exits) within the same scope (however this */ \
Modified: sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -154,8 +154,8 @@
#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_TYPE_( \
id, typename01, offset, i, bind_var_without_type) \
BOOST_PP_EXPR_IIF(typename01, typename) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id):: \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id, BOOST_PP_ADD(i, offset), \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, BOOST_PP_ADD(i, offset), \
bind_var_without_type) \
#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_( \
@@ -164,7 +164,6 @@
BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
BOOST_PP_ADD(offset, i))
-// Adapted from `BOOST_SCOPE_EXIT_AUX_ARG_DECL()`.
#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
r, id_typename_offset_const, i, bind_var_without_type) \
/* IMPORTANT: here can't use `PP_KEYWORD_IS_THISUNDERSCORE_FRONT()` */ \
@@ -246,7 +245,6 @@
, ::boost::closure::aux::nobind_t & \
/* param name not needed here because no bind param not used */
-// Adapted from `BOOST_SCOPE_EXIT_AUX_ARG_DECL()`.
#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
r, id_typename_offset_const, i, bind_traits) \
BOOST_PP_COMMA_IF(i) /* enumeration commas */ \
@@ -276,7 +274,6 @@
BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
id_typename_offset_const)))
-// Adapted from `BOOST_SCOPE_EXIT_AUX_ARG()`.
#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_( \
r, id_offset, i, bind_traits) \
BOOST_PP_COMMA_IF(i) \
@@ -284,10 +281,10 @@
BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset))) \
( /* member variable initialization */ \
static_cast< \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T( \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T( \
BOOST_PP_TUPLE_ELEM(2, 0, id_offset))* \
>(BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAMS_)-> \
- BOOST_SCOPE_EXIT_AUX_PARAM( \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM( \
BOOST_PP_TUPLE_ELEM(2, 0, id_offset) \
, BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset)) \
, BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits) \
@@ -665,7 +662,7 @@
) \
BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_const_bind_this, has_bind_this), \
BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_( \
- static_cast< BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)* >( \
+ static_cast< BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)* >( \
BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAMS_)-> \
BOOST_CLOSURE_AUX_CODE_BIND_THIS_VAR \
) \
@@ -673,7 +670,6 @@
// Functor class.
-// Adapted from `BOOST_SCOPE_EXIT_AUX_IMPL()`.
#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_(decl_traits, params, default_count, \
const_binds, has_const_bind_this, binds, has_bind_this, \
id, typename01) \
@@ -775,7 +771,8 @@
/* it makes the args variable visible within the body code (which */ \
/* cannot be static); this is for compilation only as the args */ \
/* variable is actually declared by the 1st enclosing local func */ \
- boost::scope_exit::aux::undeclared BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR; \
+ boost::scope_exit::detail::undeclared \
+ BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR; \
/* body function (unfortunately, cannot be static to allow access */ \
/* to member var with local function name for recursion but doing */ \
/* so also allows the body to misuse `this` instead of `this_`) */ \
Modified: sandbox/closure/boost/closure/aux_/macro/code_/result.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/result.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/result.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -54,8 +54,8 @@
; \
typedef \
BOOST_PP_IIF(typename01, BOOST_TYPEOF_TPL, BOOST_TYPEOF)( \
- ::boost::scope_exit::aux::wrap( \
- ::boost::scope_exit::aux::deref( \
+ ::boost::scope_exit::detail::wrap( \
+ ::boost::scope_exit::detail::deref( \
BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_(id), \
(BOOST_CLOSURE_AUX_CODE_RESULT_TAG_(id))0 \
) \
Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -32,8 +32,6 @@
BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_VOID_FRONT \
)(sign)
-/** @todo check that there's no BOOST_DETAIL_PP_KEYWORD anywhere */
-
#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_SEQ_(sign) \
BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_TOKEN_(BOOST_PP_SEQ_HEAD( \
sign))
Modified: sandbox/closure/boost/closure/config.hpp
==============================================================================
--- sandbox/closure/boost/closure/config.hpp (original)
+++ sandbox/closure/boost/closure/config.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -36,7 +36,7 @@
#endif
#ifndef BOOST_CLOSURE_CONFIG_BIND_MAX
-# define BOOST_CLOSURE_CONFIG_BIND_MAX 3 /** @todo increase this (to 10?) */
+# define BOOST_CLOSURE_CONFIG_BIND_MAX 10
#endif
#endif // #include guard
Modified: sandbox/closure/boost/closure/detail/preprocessor/variadic/is.hpp
==============================================================================
--- /sandbox/closure/boost/closure/aux_/preprocessor/variadic/is.hpp (original)
+++ sandbox/closure/boost/closure/detail/preprocessor/variadic/is.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -4,14 +4,14 @@
// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
// copy at http://www.boost.org/LICENSE_1_0.txt).
-#ifndef BOOST_CLOSURE_AUX_PP_IS_VARIADIC_HPP_
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC_HPP_
+#ifndef BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_HPP_
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_HPP_
#include <boost/config.hpp>
#if !defined(BOOST_NO_VARIADIC_MACROS) // If no variadics then no macros.
-#include <boost/closure/aux_/preprocessor/variadic/size.hpp>
+#include <boost/closure/detail/preprocessor/variadic/size.hpp>
#include <boost/preprocessor/logical/compl.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
@@ -22,29 +22,29 @@
// PRIVATE //
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC_NOT_UNARY1_(tokens) \
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_NOT_UNARY1_(tokens) \
BOOST_PP_COMPL(BOOST_PP_IS_UNARY(tokens))
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC_REMOVE1_(tokens) /* nothing */
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_REMOVE1_(tokens) /* nothing */
// Tokens `(t1) t2`.
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC_SKIP1_(tokens) \
- BOOST_CLOSURE_AUX_PP_IS_VARIADIC_NOT_UNARY1_( \
- BOOST_CLOSURE_AUX_PP_IS_VARIADIC_REMOVE1_ tokens \
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_SKIP1_(tokens) \
+ BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_NOT_UNARY1_( \
+ BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_REMOVE1_ tokens \
(1) /* trailing unary handles empty */ \
)
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC_NOT_UNARY2_(tokens) \
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_NOT_UNARY2_(tokens) \
BOOST_PP_IIF(BOOST_PP_IS_UNARY(tokens), \
- BOOST_CLOSURE_AUX_PP_IS_VARIADIC_SKIP1_ \
+ BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_SKIP1_ \
, \
1 /* it is not unary */ \
BOOST_PP_TUPLE_EAT(1) \
)(tokens)
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC_(size, ...) \
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_(size, ...) \
BOOST_PP_IIF(BOOST_PP_EQUAL(size, 1), \
- BOOST_CLOSURE_AUX_PP_IS_VARIADIC_NOT_UNARY2_ \
+ BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_NOT_UNARY2_ \
, /* size == 0 or size > 1 (it's variadic) */ \
1 \
BOOST_PP_EAT \
@@ -52,9 +52,9 @@
// PUBLIC //
-#define BOOST_CLOSURE_AUX_PP_IS_VARIADIC(...) \
- BOOST_CLOSURE_AUX_PP_IS_VARIADIC_( \
- BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE(__VA_ARGS__), __VA_ARGS__)
+#define BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC(...) \
+ BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC_( \
+ BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE(__VA_ARGS__), __VA_ARGS__)
#endif // BOOST_NO_VARIADIC_MACROS
Modified: sandbox/closure/boost/closure/detail/preprocessor/variadic/size.hpp
==============================================================================
--- /sandbox/closure/boost/closure/aux_/preprocessor/variadic/size.hpp (original)
+++ sandbox/closure/boost/closure/detail/preprocessor/variadic/size.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -4,8 +4,8 @@
// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
// copy at http://www.boost.org/LICENSE_1_0.txt).
-#ifndef BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_HPP_
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_HPP_
+#ifndef BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_HPP_
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_HPP_
#include <boost/config.hpp>
@@ -22,19 +22,19 @@
// PRIVATE //
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_1OR0_TOKEN_(maybe_empty) \
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_1OR0_TOKEN_(maybe_empty) \
BOOST_PP_IIF(BOOST_PP_IS_EMPTY(maybe_empty (/*exapnd empty */) ), 0, 1)
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_1OR0_(maybe_empty) \
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_1OR0_(maybe_empty) \
BOOST_PP_IIF(BOOST_PP_IS_UNARY(maybe_empty (/*exapnd empty */) ), \
1 BOOST_PP_EAT \
, \
- BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_1OR0_TOKEN_ \
+ BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_1OR0_TOKEN_ \
)(maybe_empty)
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_(size, ...) \
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_(size, ...) \
BOOST_PP_IIF(BOOST_PP_EQUAL(size, 1), \
- BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_1OR0_ \
+ BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_1OR0_ \
, \
size BOOST_PP_EAT \
)(__VA_ARGS__ BOOST_PP_EMPTY)
@@ -42,8 +42,8 @@
// PUBLIC //
// Expand () to 0 (differently from BOOST_PP_VARIADIC_SIZE() that expand to 1).
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE(...) \
- BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE_(BOOST_PP_VARIADIC_SIZE( \
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE(...) \
+ BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE_(BOOST_PP_VARIADIC_SIZE( \
__VA_ARGS__), __VA_ARGS__)
#endif // BOOST_NO_VARIADIC_MACROS
Modified: sandbox/closure/boost/closure/detail/preprocessor/variadic/to_seq.hpp
==============================================================================
--- /sandbox/closure/boost/closure/aux_/preprocessor/variadic/to_seq.hpp (original)
+++ sandbox/closure/boost/closure/detail/preprocessor/variadic/to_seq.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -4,14 +4,14 @@
// License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
// copy at http://www.boost.org/LICENSE_1_0.txt).
-#ifndef BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ_HPP_
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ_HPP_
+#ifndef BOOST_CLOSURE_DETAIL_PP_VARIADIC_TO_SEQ_HPP_
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_TO_SEQ_HPP_
#include <boost/config.hpp>
#if !defined(BOOST_NO_VARIADIC_MACROS) // If no variadics then no macros.
-#include <boost/closure/aux_/preprocessor/variadic/is.hpp>
+#include <boost/closure/detail/preprocessor/variadic/is.hpp>
#include <boost/preprocessor/variadic/to_seq.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/control/if.hpp>
@@ -20,8 +20,8 @@
// PRIVATE //
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ_NOT_EMPTY_(...) \
- BOOST_PP_IIF(BOOST_CLOSURE_AUX_PP_IS_VARIADIC(__VA_ARGS__), \
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_TO_SEQ_NOT_EMPTY_(...) \
+ BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_IS_VARIADIC(__VA_ARGS__), \
BOOST_PP_VARIADIC_TO_SEQ \
, \
BOOST_PP_REM \
@@ -31,9 +31,9 @@
// Expand to `(arg0)(arg1)...` is __VA_ARGS__ is `arg0, arg1, ...` or already
// `(arg0)(arg1)...`, if __VA_ARGS__ is empty `` expand to `empty_seq`.
-#define BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ(empty_seq, ...) \
- BOOST_PP_IF(BOOST_CLOSURE_AUX_PP_VARIADIC_SIZE(__VA_ARGS__), \
- BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ_NOT_EMPTY_ \
+#define BOOST_CLOSURE_DETAIL_PP_VARIADIC_TO_SEQ(empty_seq, ...) \
+ BOOST_PP_IF(BOOST_CLOSURE_DETAIL_PP_VARIADIC_SIZE(__VA_ARGS__), \
+ BOOST_CLOSURE_DETAIL_PP_VARIADIC_TO_SEQ_NOT_EMPTY_ \
, \
empty_seq BOOST_PP_EAT \
)(__VA_ARGS__)
Modified: sandbox/closure/boost/scope_exit.hpp
==============================================================================
--- sandbox/closure/boost/scope_exit.hpp (original)
+++ sandbox/closure/boost/scope_exit.hpp 2012-01-08 19:23:56 EST (Sun, 08 Jan 2012)
@@ -1,4 +1,6 @@
+
// Copyright Alexander Nasonov 2006-2009, 2011
+// Copyright Lorenzo Caminiti 2012
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -8,56 +10,6 @@
#define FILE_boost_scope_exit_hpp_INCLUDED
#include <boost/config.hpp>
-
-#if !defined(BOOST_NO_LAMBDAS) \
- && !defined(BOOST_NO_AUTO_DECLARATIONS) \
- && !defined(BOOST_SCOPE_EXIT_FORCE_CXX98)
-#define BOOST_SCOPE_EXIT_AUX_CXX0X
-#endif
-
-#if defined(BOOST_SCOPE_EXIT_AUX_CXX0X)
-
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/seq/enum.hpp>
-
-namespace boost { namespace scope_exit { namespace aux {
-
-template<class F>
-struct guard
-{
- F fn_;
- guard(F f) : fn_(f) {}
- ~guard() { fn_(); }
-};
-
-struct guard_maker
-{
- template<class F>
- guard<F> operator%(F f) const
- {
- return guard<F>(f);
- }
-};
-
-} } }
-
-#define BOOST_SCOPE_EXIT_AUX_IMPL(id, seq) \
- auto BOOST_PP_CAT(boost_se_fn_, id) = \
- ::boost::scope_exit::aux::guard_maker() % \
- [BOOST_PP_SEQ_ENUM(seq)]() mutable -> void
-
-#if defined(BOOST_MSVC)
-#define BOOST_SCOPE_EXIT(seq) BOOST_SCOPE_EXIT_AUX_IMPL(__COUNTER__, seq)
-#else
-#define BOOST_SCOPE_EXIT(seq) BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq)
-#endif
-
-#define BOOST_SCOPE_EXIT_TPL(seq) BOOST_SCOPE_EXIT(seq)
-
-#define BOOST_SCOPE_EXIT_END ;
-
-#else
-
#include <boost/detail/workaround.hpp>
#include <boost/mpl/int.hpp>
#include <boost/utility/enable_if.hpp>
@@ -65,11 +17,18 @@
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/seq/cat.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/facilities/identity.hpp>
#include <boost/typeof/typeof.hpp>
+// PRIVATE/PROTECTED //
+
+// NOTE: AUX prefix and aux namespace mark private symbols that shall be used
+// only within this library; DETAIL prefix and detail namespace mark "protected"
+// symbols that can be used by other Boost libraries but not outside Boost.
+
#if defined(__GNUC__) && !defined(BOOST_INTEL)
# define BOOST_SCOPE_EXIT_AUX_GCC (__GNUC__ * 100 + __GNUC_MINOR__)
#else
@@ -81,44 +40,39 @@
#endif
// Steven Watanabe's trick with a modification suggested by Kim Barrett
-namespace boost { namespace scope_exit { namespace aux {
- // Type of a local boost_scope_exit_args variable.
- // First use in a local scope will declare the boost_scope_exit_args
- // variable, subsequent uses will be resolved as two comparisons
- // (cmp1 with 0 and cmp2 with boost_scope_exit_args).
- template<int Dummy = 0>
- struct declared
- {
- void* value;
- static int const cmp2 = 0;
- friend void operator>(int, declared const&) {}
- };
+namespace boost { namespace scope_exit { namespace detail {
- struct undeclared { declared<> dummy[2]; };
+// Type of a local BOOST_SCOPE_EXIT_AUX_ARGS variable.
+// First use in a local scope will declare the BOOST_SCOPE_EXIT_AUX_ARGS
+// variable, subsequent uses will be resolved as two comparisons
+// (cmp1 with 0 and cmp2 with BOOST_SCOPE_EXIT_AUX_ARGS).
+template<int Dummy = 0>
+struct declared
+{
+ void* value;
+ static int const cmp2 = 0;
+ friend void operator>(int, declared const&) {}
+};
- template<int> struct resolve;
+struct undeclared { declared<> dummy[2]; };
- template<>
- struct resolve<sizeof(declared<>)>
- {
- static const int cmp1 = 0;
- };
+template<int> struct resolve;
- template<>
- struct resolve<sizeof(undeclared)>
+template<>
+struct resolve<sizeof(declared<>)>
+{
+ static const int cmp1 = 0;
+};
+
+template<>
+struct resolve<sizeof(undeclared)>
+{
+ template<int>
+ struct cmp1
{
- template<int>
- struct cmp1
- {
- static int const cmp2 = 0;
- };
+ static int const cmp2 = 0;
};
-} } }
-
-extern boost::scope_exit::aux::undeclared boost_scope_exit_args; // undefined
-
-
-namespace boost { namespace scope_exit { namespace aux {
+};
typedef void (*ref_tag)(int&);
typedef void (*val_tag)(int );
@@ -157,58 +111,65 @@
} } }
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::aux::wrapper, 1)
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::detail::wrapper, 1)
+
+#define BOOST_SCOPE_EXIT_AUX_ARGS boost_scope_exit_aux_args
+extern boost::scope_exit::detail::undeclared BOOST_SCOPE_EXIT_AUX_ARGS;
#define BOOST_SCOPE_EXIT_AUX_GUARD(id) BOOST_PP_CAT(boost_se_guard_, id)
#define BOOST_SCOPE_EXIT_AUX_GUARD_T(id) BOOST_PP_CAT(boost_se_guard_t_, id)
#define BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_PP_CAT(boost_se_params_, id)
-#define BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) BOOST_PP_CAT(boost_se_params_t_, id)
-#define BOOST_SCOPE_EXIT_AUX_TAG(id, i) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) \
+ BOOST_PP_CAT(boost_se_params_t_, id)
+
+#define BOOST_SCOPE_EXIT_DETAIL_TAG(id, i) \
BOOST_PP_SEQ_CAT( (boost_se_tag_)(i)(_)(id) )
-#define BOOST_SCOPE_EXIT_AUX_PARAM(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM(id, i, var) \
BOOST_PP_SEQ_CAT( (boost_se_param_)(i)(_)(id) )
-#define BOOST_SCOPE_EXIT_AUX_PARAM_T(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, i, var) \
BOOST_PP_SEQ_CAT( (boost_se_param_t_)(i)(_)(id) )
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_T(id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(id, i, var) \
BOOST_PP_SEQ_CAT( (boost_se_capture_t_)(i)(_)(id) )
#define BOOST_SCOPE_EXIT_AUX_WRAPPED(id, i) \
BOOST_PP_SEQ_CAT( (boost_se_wrapped_t_)(i)(_)(id) )
#define BOOST_SCOPE_EXIT_AUX_DEREF(id, i, var) \
- boost::scope_exit::aux::deref(var, (BOOST_SCOPE_EXIT_AUX_TAG(id,i))0)
+ boost::scope_exit::detail::deref(var, (BOOST_SCOPE_EXIT_DETAIL_TAG(id,i))0)
#define BOOST_SCOPE_EXIT_AUX_MEMBER(r, id, i, var) \
- boost::scope_exit::aux::member< \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var), \
- BOOST_SCOPE_EXIT_AUX_TAG(id,i) \
- > BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var);
+ boost::scope_exit::detail::member< \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id,i,var), \
+ BOOST_SCOPE_EXIT_DETAIL_TAG(id,i) \
+ > BOOST_SCOPE_EXIT_DETAIL_PARAM(id,i,var);
// idty is (id,typename) or (id,BOOST_PP_EMPTY())
-#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, idty, i, var) \
- BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2,1,idty) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(BOOST_PP_TUPLE_ELEM(2,0,idty)):: \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) var
+#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, idty, i, var) \
+ BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2,1,idty) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(BOOST_PP_TUPLE_ELEM(2,0,idty)):: \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) var
#define BOOST_SCOPE_EXIT_AUX_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- boost_se_params_->BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var).value
+ boost_se_params_->BOOST_SCOPE_EXIT_DETAIL_PARAM(id,i,var).value
-#define BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, var) \
- typedef void (*BOOST_SCOPE_EXIT_AUX_TAG(id,i))(int var);
+#define BOOST_SCOPE_EXIT_DETAIL_TAG_DECL(r, id, i, var) \
+ typedef void (*BOOST_SCOPE_EXIT_DETAIL_TAG(id,i))(int var);
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1300)
+// Adam Butcher's workaround to deduce `this` type on MSVC revision < 10.
// Boost.Typeof for VC71's typeid-based workaround does not work to determine
// `this` type due to error C2355 being incorrectly reported. The typical
// avoidance strategy implemented below is to make an indirect compile-time
// constant by assigning an enum and use that as type-index-- this only works
// with the sizeof() approach and not with the typeid() approach.
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1300)
namespace boost { namespace scope_exit { namespace aux {
namespace msvc_typeof_this {
+
template<int Id>
struct msvc_typeid_wrapper
{
@@ -216,14 +177,13 @@
>::id2type id2type;
typedef typename id2type::type type;
};
+
template<>
struct msvc_typeid_wrapper<4>
{
typedef msvc_typeid_wrapper<4> type;
};
-/** @todo add authorships notes at top including contributer of this typeof workaround */
-
template<typename T>
struct encode_type
{
@@ -232,8 +192,6 @@
typedef typename boost::type_of::msvc_register_type<T,
boost::mpl::int_<value> >::id2type type;
BOOST_STATIC_CONSTANT(unsigned, next = value + 1);
-// @todo remove friend char (*boost::type_of::encode_index(
-// boost::type_of::encode_counter<next>*))[next];
};
template<class T>
@@ -247,6 +205,7 @@
typename boost::is_function<T>::type
, typename sizer<T>::type
>::type encode_start(T const&);
+
template<typename T>
typename boost::enable_if<
typename boost::is_function<T>::type
@@ -256,12 +215,13 @@
template<typename Organizer, typename T>
boost::type_of::msvc_register_type<T, Organizer> typeof_register_type(
const T&, Organizer* = 0);
+
}}}} // namespace
#define BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_ \
BOOST_PP_CAT(boost_se_thistype_index_, __LINE__)
-#define BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS(new_type) \
+#define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(new_type) \
enum { BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS_INDEX_ = sizeof(*::boost \
::scope_exit::aux::msvc_typeof_this::encode_start(this)) }; \
typedef ::boost::scope_exit::aux::msvc_typeof_this::msvc_typeid_wrapper< \
@@ -269,7 +229,7 @@
#else // typeof(this) on other compilers are OK.
-#define BOOST_SCOPE_EXIT_AUX_TYPEDEF_TYPEOF_THIS(new_type) \
+#define BOOST_SCOPE_EXIT_DETAIL_TYPEDEF_TYPEOF_THIS(new_type) \
typedef BOOST_TYPEOF(this) new_type;
#endif // typeof(this)
@@ -278,83 +238,133 @@
#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq)
-#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, var) \
BOOST_PP_COMMA_IF(i) { BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var) }
#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \
- = { BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) };
+ = { BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT, id, seq) };
#else
#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var) & BOOST_PP_CAT(a,i)
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id,i,var) & BOOST_PP_CAT(a,i)
#define BOOST_SCOPE_EXIT_AUX_MEMBER_INIT(r, id, i, var) BOOST_PP_COMMA_IF(i) \
- BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var) ( BOOST_PP_CAT(a,i) )
+ BOOST_SCOPE_EXIT_DETAIL_PARAM(id,i,var) ( BOOST_PP_CAT(a,i) )
#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)( \
+ BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)( \
BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CTOR_ARG, id, seq ) ) \
: BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER_INIT, id, seq) {}
-#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT(r, id, i, var) \
BOOST_PP_COMMA_IF(i) BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var)
#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \
- ( BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) );
+ ( BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_INIT, id, seq) );
#endif
#if defined(BOOST_TYPEOF_EMULATION)
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, idty, i, var) \
struct BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i) \
- : BOOST_TYPEOF(boost::scope_exit::aux::wrap( \
+ : BOOST_TYPEOF(boost::scope_exit::detail::wrap( \
BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \
{}; typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \
BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, \
+ var);
#elif defined(BOOST_INTEL)
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- typedef BOOST_TYPEOF_KEYWORD( \
- BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var)) \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, idty, i, var) \
+ typedef BOOST_TYPEOF_KEYWORD( \
+ BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var)) \
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, \
+ var);
#else
-#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \
- typedef BOOST_TYPEOF(boost::scope_exit::aux::wrap( \
+#define BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL(r, idty, i, var) \
+ typedef BOOST_TYPEOF(boost::scope_exit::detail::wrap( \
BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \
BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i); \
typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \
BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+ BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, \
+ var);
#endif
-#define BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, idty, i, var) \
- typedef BOOST_SCOPE_EXIT_AUX_CAPTURE_T( \
- BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) \
- BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+#define BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL(r, idty, i, var) \
+ typedef BOOST_SCOPE_EXIT_DETAIL_CAPTURE_T( \
+ BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) \
+ BOOST_SCOPE_EXIT_DETAIL_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var);
+
+// PUBLIC //
+
+#if !defined(BOOST_NO_LAMBDAS) && !defined(BOOST_NO_AUTO_DECLARATIONS) && \
+ !defined(BOOST_SCOPE_EXIT_FORCE_CXX98)
+// NOTE: Even if using C++0x lambdas, must define symbols above because
+// DETAIL/detail symbols are used by other Boost libraries.
+
+namespace boost { namespace scope_exit { namespace aux {
+
+template<class F>
+struct guard
+{
+ F fn_;
+ guard(F f) : fn_(f) {}
+ ~guard() { fn_(); }
+};
+
+struct guard_maker
+{
+ template<class F>
+ guard<F> operator%(F f) const
+ {
+ return guard<F>(f);
+ }
+};
+
+} } }
+
+#define BOOST_SCOPE_EXIT_AUX_IMPL(id, seq) \
+ auto BOOST_PP_CAT(boost_se_fn_, id) = \
+ ::boost::scope_exit::aux::guard_maker() % \
+ [BOOST_PP_SEQ_ENUM(seq)]() mutable -> void
+
+#if defined(BOOST_MSVC)
+#define BOOST_SCOPE_EXIT(seq) BOOST_SCOPE_EXIT_AUX_IMPL(__COUNTER__, seq)
+#else
+#define BOOST_SCOPE_EXIT(seq) BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq)
+#endif
+
+#define BOOST_SCOPE_EXIT_TPL(seq) BOOST_SCOPE_EXIT(seq)
+
+#define BOOST_SCOPE_EXIT_END ;
+
+#else // C++0x lambdas
#define BOOST_SCOPE_EXIT_AUX_IMPL(id, seq, ty) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_TAG_DECL, id, seq) \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL, (id,ty), seq) \
- struct BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) { \
- BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_DECL, (id,ty), seq) \
+ BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_TAG_DECL, id, seq) \
+ BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_CAPTURE_DECL, (id,ty), seq)\
+ struct BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id) { \
+ BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_DETAIL_PARAM_DECL, (id,ty), \
+ seq) \
BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, seq) \
BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \
} BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id,seq) \
- boost::scope_exit::aux::declared< boost::scope_exit::aux::resolve< \
- sizeof(boost_scope_exit_args)>::cmp1<0>::cmp2 > boost_scope_exit_args; \
- boost_scope_exit_args.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \
+ boost::scope_exit::detail::declared< boost::scope_exit::detail::resolve< \
+ sizeof(BOOST_SCOPE_EXIT_AUX_ARGS)>::cmp1<0>::cmp2 > \
+ BOOST_SCOPE_EXIT_AUX_ARGS; \
+ BOOST_SCOPE_EXIT_AUX_ARGS.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \
struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \
- BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)* boost_se_params_; \
+ 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_AUX_PARAMS_T(id)*)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_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, seq) ); } \
@@ -364,7 +374,7 @@
#if defined(BOOST_MSVC)
#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__COUNTER__) ( \
- boost_scope_exit_args.value);
+ BOOST_SCOPE_EXIT_AUX_ARGS.value);
#define BOOST_SCOPE_EXIT(seq) \
BOOST_SCOPE_EXIT_AUX_IMPL(__COUNTER__, seq, BOOST_PP_EMPTY())
@@ -372,7 +382,7 @@
#else
#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__LINE__) ( \
- boost_scope_exit_args.value);
+ BOOST_SCOPE_EXIT_AUX_ARGS.value);
#define BOOST_SCOPE_EXIT(seq) \
BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, BOOST_PP_EMPTY())
@@ -386,6 +396,7 @@
#define BOOST_SCOPE_EXIT_TPL(seq) BOOST_SCOPE_EXIT(seq)
#endif
-#endif // #if defined(BOOST_SCOPE_EXIT_AUX_CXX0X)
+#endif // C++0x lambdas
#endif // #ifndef FILE_boost_scope_exit_hpp_INCLUDED
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk