Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76042 - in sandbox/closure/boost: . closure/aux_ closure/aux_/macro closure/aux_/macro/code_ closure/aux_/preprocessor/traits closure/aux_/preprocessor/traits/decl_ closure/aux_/preprocessor/variadic closure/detail/preprocessor/keyword
From: lorcaminiti_at_[hidden]
Date: 2011-12-18 11:18:33


Author: lcaminiti
Date: 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
New Revision: 76042
URL: http://svn.boost.org/trac/boost/changeset/76042

Log:
Impl closure macros.
Added:
   sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp
      - copied, changed from r76030, /sandbox/closure/boost/closure/aux_/macro/code_/binding.hpp
   sandbox/closure/boost/closure/aux_/macro/code_/result.hpp
      - copied, changed from r76030, /sandbox/closure/boost/closure/aux_/macro/code_/deduce_result_type.hpp
Removed:
   sandbox/closure/boost/closure/aux_/macro/code_/bind_this.hpp
   sandbox/closure/boost/closure/aux_/macro/code_/binding.hpp
   sandbox/closure/boost/closure/aux_/macro/code_/deduce_result_type.hpp
Text files modified:
   sandbox/closure/boost/boost_config.hpp | 34 -
   sandbox/closure/boost/closure.hpp | 8
   sandbox/closure/boost/closure/aux_/macro/closure.hpp | 216 ++----------
   sandbox/closure/boost/closure/aux_/macro/closure_end.hpp | 54 ---
   sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp | 281 +++++++++-------
   sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp | 650 ++++++++++++++++++++-------------------
   sandbox/closure/boost/closure/aux_/macro/code_/result.hpp | 136 ++++++--
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/append.hpp | 2
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_params.hpp | 28
   sandbox/closure/boost/closure/aux_/preprocessor/variadic/is.hpp | 5
   sandbox/closure/boost/closure/aux_/symbol.hpp | 118 +-----
   sandbox/closure/boost/closure/detail/preprocessor/keyword/recursive.hpp | 6
   12 files changed, 709 insertions(+), 829 deletions(-)

Modified: sandbox/closure/boost/boost_config.hpp
==============================================================================
--- sandbox/closure/boost/boost_config.hpp (original)
+++ sandbox/closure/boost/boost_config.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,29 +4,21 @@
 // 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_LOCAL_AUX_CONFIG_HPP_
-#define BOOST_LOCAL_AUX_CONFIG_HPP_
+#ifndef BOOST_CONFIG_HPP_
+#define BOOST_CONFIG_HPP_
 
-#include "../config.hpp"
+#include <boost/config.hpp>
 
-// If it is possible to pass local types (classes, etc) as
-// template parameters. This is not possible in pure C++03 but it
-// is possible in some C++03 extensions (MSVC, GCC 4.5.x, etc).
-#if !defined(BOOST_LOCAL_CONFIG_COMPLIANT)
-# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
- // From GCC 4.5.x when -std=c++0x specified.
-# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS
-# endif
-# if defined(_MSC_VER)
- // For (all?) MSVC (tested on MVSC 8.0).
-# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS
-# endif
-#endif
-
-#if defined(BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS)
-# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01 1
-#else
-# define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01 0
+// If it is possible to pass local types (classes, etc) as template parameters.
+// This is not possible in pure C++03 but it is possible in some C++03
+// extensions (MSVC, GCC 4.5.x, etc).
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) && \
+ defined(__GXX_EXPERIMENTAL_CXX0X__)
+ // From GCC 4.5.x when -std=c++0x specified.
+# define BOOST_LOCAL_TYPES_AS_TEMPLATE_PARAMS
+#elif defined(_MSC_VER)
+ // For (all?) MSVC (tested on MVSC 8.0).
+# define BOOST_LOCAL_TYPES_AS_TEMPLATE_PARAMS
 #endif
 
 #endif // #include guard

Modified: sandbox/closure/boost/closure.hpp
==============================================================================
--- sandbox/closure/boost/closure.hpp (original)
+++ sandbox/closure/boost/closure.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -12,11 +12,9 @@
 #ifndef BOOST_CLOSURE_HPP_
 #define BOOST_CLOSURE_HPP_
 
-#include <boost/closure/config.hpp>
-#include <boost/closure/aux_/symbol.hpp>
 #include <boost/closure/aux_/macro/closure.hpp>
 #include <boost/closure/aux_/macro/closure_end.hpp>
-#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/closure/aux_/macro/closure_typeof.hpp>
 #include <boost/config.hpp> // For variadic macros.
 
 // Pass a parenthesized params seq `()()...` on C++. If variadic macros (C99,
@@ -160,7 +158,7 @@
 #include <boost/closure/aux_/preprocessor/variadic/to_seq.hpp>
 
 #define BOOST_CLOSURE_(id, is_template, ...) \
- BOOST_CLOSURES_AUX_CLOSURE(BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ( \
+ BOOST_CLOSURE_AUX_CLOSURE(BOOST_CLOSURE_AUX_PP_VARIADIC_TO_SEQ( \
             (void) /* for empty seq */, __VA_ARGS__), \
             id, is_template)
 
@@ -266,7 +264,7 @@
  * section.
  */
 #define BOOST_CLOSURE_TYPEOF(bound_variable_name) \
- BOOST_CLOSURE_AUX_SYMBOL_TYPEOF_TYPE(bound_variable_name)
+ BOOST_CLOSURE_AUX_CLOSURE_TYPEOF(bound_variable_name)
 
 #endif // #include guard
 

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 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,185 +4,65 @@
 // 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_LOCAL_AUX_FUNCTION_NAME_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_HPP_
+#ifndef BOOST_CLOSURE_AUX_CLOSURE_HPP_
+#define BOOST_CLOSURE_AUX_CLOSURE_HPP_
 
-#include "../preprocessor/keyword/recursive.hpp"
-#include "../symbol.hpp"
-#include "../config.hpp"
-// For BOOST_TYPEOF.
-#include "../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include <boost/detail/preprocessor/keyword/inline.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/mpl/assert.hpp>
 #include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/control/expr_iif.hpp>
-#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/list/adt.hpp>
 #include <boost/preprocessor/tuple/eat.hpp>
 
-// PRIVATE //
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_ \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(init_recursion)
+// 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;
 
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_FUNC_( \
- is_recursive, local_function_name) \
- BOOST_PP_IIF(is_recursive, \
- local_function_name \
- , \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(nonrecursive_local_function_name) \
- )
+// PRIVATE //
 
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(id, \
- local_function_name, is_recursive, \
- local_functor_name, nonlocal_functor_name) \
- /* `PARAMS() { ... }` expandsion here -- still within functor class */ \
- /* class functor ## __LINE__ { ... */ \
- public: \
- /* member var with function name for recursive calls; must be */ \
- /* `public` because is it also used by this macro but outside */ \
- /* the functor class to deduce the functor type; it cannot be */ \
- /* `const` because it is init after construction (because */ \
- /* constructor doesn't know local function name) */ \
- /* run-time: even when optimizing, recursive calls cannot be */ \
- /* optimized (i.e., they must be via the non-local functor) */ \
- /* because this cannot be a mem ref because its name is not known */ \
- /* by the constructor so it cannot be set by the mem init list */ \
- BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE \
- BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_FUNC_(is_recursive, \
- local_function_name); \
- BOOST_PP_EXPR_IIF(is_recursive, \
- /* run-time: the `init_recursion()` function cannot be called */ \
- /* by the constructor to allow for compiler optimization */ \
- /* (inlining) so it must be public */ \
- inline void BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_( \
- BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE& functor) { \
- local_function_name = functor; \
- } \
- ) \
- /* local functor can be passed as tparam only on C++11 (faster) */ \
- } local_functor_name(BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME.value); \
- /* non-local functor can always be passed as tparam (but slower) */ \
- BOOST_TYPEOF(local_functor_name. \
- BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_FUNC_(is_recursive, \
- local_function_name)) \
- nonlocal_functor_name; \
- /* the order of the following 2 function calls cannot be changed */ \
- /* because init_recursion uses the local_functor so the local_functor */ \
- /* must be init first */ \
- local_functor_name.BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME( \
- &local_functor_name, nonlocal_functor_name); \
- BOOST_PP_EXPR_IIF(is_recursive, \
- /* init recursion causes MSVC to not optimize local function not */ \
- /* even when local functor is used as template parameter so no */ \
- /* recursion unless all inlining optimizations are specified off */ \
- local_functor_name.BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_( \
- nonlocal_functor_name); \
- )
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(local_function_name)
-
-// This can always be passed as a template parameters (on all compilers).
-// However, it is slower because it cannot be inlined.
-// Passed at tparam: Yes (on all C++). Inlineable: No. Recursive: No.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
- local_function_name, \
- /* local function is not recursive (because recursion and its */ \
- /* initialization cannot be inlined even on C++11, */ \
- /* so this allows optimization at least on C++11) */ \
- 0 /* not recursive */ , \
- /* local functor */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name), \
- /* local function declared as non-local functor -- but it can */ \
- /* be inlined only by C++11 and it cannot be recursive */ \
- local_function_name)
-
-// This is faster on some compilers but not all (e.g., it is faster on GCC
-// because its optimization inlines it but not on MSVC). However, it cannot be
-// passed as a template parameter on non C++11 compilers.
-// Passed at tparam: Only on C++11. Inlineable: Yes. Recursive: No.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_INLINE_(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
- local_function_name, \
- /* inlined local function is never recursive (because recursion */ \
- /* and its initialization cannot be inlined)*/ \
- 0 /* not recursive */ , \
- /* inlined local function declared as local functor (maybe */ \
- /* inlined even by non C++11 -- but it can be passed as */ \
- /* template parameter only on C++11 */ \
- local_function_name, \
- /* non-local functor */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name))
-
-// This is slower on all compilers (C++11 and non) because recursion and its
-// initialization can never be inlined.
-// Passed at tparam: Yes. Inlineable: No. Recursive: Yes.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_(local_function_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_END_LOCAL_FUNCTOR_(__LINE__, \
- local_function_name, \
- /* recursive local function -- but it cannot be inlined */ \
- 1 /* recursive */ , \
- /* local functor */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name), \
- /* local function declared as non-local functor -- but it can */ \
- /* be inlined only by C++11 */ \
- local_function_name)
-
-// Inlined local functions are specified by `..._NAME(inline name)`.
-// They have more chances to be inlined for faster run-times by some compilers
-// (for example by GCC but not by MSVC). C++11 compilers can always inline
-// local functions even if they are not explicitly specified inline.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_PARSE_INLINE_(qualified_name) \
- BOOST_PP_IIF(BOOST_PP_BITOR( \
- BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01, \
- BOOST_DETAIL_PP_KEYWORD_IS_INLINE_FRONT(qualified_name)), \
- /* on C++11 always use inlining because compilers might optimize */ \
- /* it to be faster and it can also be passed as tparam */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_INLINE_ \
- , \
- /* on non C++11 don't use liniling unless explicitly specified by */ \
- /* programmers `inline name` the inlined local function cannot be */ \
- /* passed as tparam */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_ \
- )(BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(qualified_name))
-
-// Expand to 1 iff `recursive name` or `recursive inline name` or
-// `inline recursive name`.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_IS_RECURSIVE_(qualified_name) \
- BOOST_LOCAL_AUX_PP_KEYWORD_IS_RECURSIVE_FRONT( \
- BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT(qualified_name))
-
-// Revmoes `recursive`, `inline recursive`, and `recursive inline` from front.
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_REMOVE_RECURSIVE_AND_INLINE_( \
- qualified_name) \
- BOOST_LOCAL_AUX_PP_KEYWORD_RECURSIVE_REMOVE_FRONT( \
- BOOST_DETAIL_PP_KEYWORD_INLINE_REMOVE_FRONT( \
- BOOST_LOCAL_AUX_PP_KEYWORD_RECURSIVE_REMOVE_FRONT( \
- qualified_name \
- )))
-
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_REMOVE_(qualified_name) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_FUNCTION_NAME_IS_RECURSIVE_(qualified_name), \
- BOOST_LOCAL_AUX_FUNCTION_NAME_REMOVE_RECURSIVE_AND_INLINE_ \
- , \
- qualified_name /* might be `name` or `inline name` */ \
+#define BOOST_CLOSURE_AUX_CLOSURE_OK_(decl_traits, id, typename01) \
+ BOOST_CLOSURE_AUX_CODE_RESULT(decl_traits, id, typename01) \
+ BOOST_CLOSURE_AUX_CODE_BIND(decl_traits, id, typename01) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR(decl_traits, id, typename01)
+
+#define BOOST_CLOSURE_AUX_CLOSURE_ERROR_(decl_traits, id, typename01) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits)), \
+ /* return specified, so no result type before this macro expansion */ \
         BOOST_PP_TUPLE_EAT(1) \
- )(qualified_name)
-
-// Recursive local function are specified by `..._NAME(recursive name)`.
-// They can never be inlined for faster run-time (not even by C++11 compilers).
-#define BOOST_LOCAL_AUX_FUNCTION_NAME_PARSE_RECURSIVE_(qualified_name) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_FUNCTION_NAME_IS_RECURSIVE_(qualified_name), \
- /* recursion can never be inlined (not even on C++11) */ \
- BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_ \
     , \
- BOOST_LOCAL_AUX_FUNCTION_NAME_PARSE_INLINE_ \
- )(BOOST_LOCAL_AUX_FUNCTION_NAME_RECURSIVE_REMOVE_(qualified_name))
+ /* even if error, must declare result type to prevent additional */ \
+ /* error due to result type appearing before this macro expansion */ \
+ BOOST_CLOSURE_AUX_CODE_RESULT_DECL \
+ )(id) \
+ ; /* close eventual previous statements, otherwise it has no effect */ \
+ BOOST_MPL_ASSERT_MSG(false, /* always fails (there's an error) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR_MSG(decl_traits), ()) \
+ ; /* must close ASSERT macro for eventual use within class scope */
+
+// sign_params: parsed parenthesized params.
+#define BOOST_CLOSURE_AUX_CLOSURE_(decl_traits, id, typename01) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR_MSG( \
+ decl_traits)), \
+ BOOST_CLOSURE_AUX_CLOSURE_OK_ \
+ , \
+ BOOST_CLOSURE_AUX_CLOSURE_ERROR_ \
+ )(decl_traits, id, typename01)
 
 // PUBLIC //
 
-#define BOOST_LOCAL_AUX_FUNCTION_NAME(qualified_name) \
- BOOST_LOCAL_AUX_FUNCTION_NAME_PARSE_RECURSIVE_(qualified_name)
+#define BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR \
+ BOOST_CLOSURE_AUX_SYMBOL( (args) )
+
+#define BOOST_CLOSURE_AUX_CLOSURE(decl_seq, id, typename01) \
+ BOOST_CLOSURE_AUX_CLOSURE_(BOOST_CLOSURE_AUX_PP_DECL_TRAITS(decl_seq), \
+ id, typename01)
 
 #endif // #include guard
 

Modified: sandbox/closure/boost/closure/aux_/macro/closure_end.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/closure_end.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/closure_end.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,59 +4,15 @@
 // 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_LOCAL_AUX_FUNCTION_PARAMS_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_HPP_
+#ifndef BOOST_CLOSURE_AUX_CLOSURE_END_HPP_
+#define BOOST_CLOSURE_AUX_CLOSURE_END_HPP_
 
-#include "code_/binding.hpp"
-#include "code_/functor.hpp"
-#include "code_/deduce_result_type.hpp"
-#include "../symbol.hpp"
-#include "../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include "../preprocessor/sign/parse_params.hpp"
-#include "../preprocessor/sign/params_error.hpp"
-#include <boost/mpl/assert.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-
-// 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_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME;
-
-// PRIVATE //
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_TYPENAME_KEYWORD_(is_template) \
- BOOST_PP_IIF(is_template, BOOST_PP_IDENTITY(typename), BOOST_PP_EMPTY)()
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_OK_(sign_params, id, is_template) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING(sign_params, id, \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_TYPENAME_KEYWORD_(is_template)) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR(sign_params, id, \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_TYPENAME_KEYWORD_(is_template))
-
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_ERROR_(sign_params, id, is_template) \
- ; /* close eventual previous statements, otherwise it has no effect */ \
- BOOST_MPL_ASSERT_MSG(false, /* always fails (there's an error) */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ERROR_MSG(sign_params), ()) \
- ; /* must close ASSERT macro for eventual use within class scope */
-
-// sign_params: parsed parenthesized params.
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS_(sign_params, id, is_template) \
- /* this must follow the result type (this code must be always present */ \
- /* even if there's an error because result type always present) */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE(id, is_template) \
- /* rest of the code */ \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_HAVE_ERROR(sign_params), \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_ERROR_ \
- , \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_OK_ \
- )(sign_params, id, is_template)
+#include <boost/closure/aux_/macro/code_/end.hpp>
 
 // PUBLIC //
 
-#define BOOST_LOCAL_AUX_FUNCTION_PARAMS(parenthesized_params, id, is_template) \
- BOOST_LOCAL_AUX_FUNCTION_PARAMS_( \
- BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS(parenthesized_params), \
- id, is_template)
+#define BOOST_CLOSURE_AUX_CLOSURE_END(qualified_name) \
+ BOOST_CLOSURE_AUX_CODE_END(qualified_name)
 
 #endif // #include guard
 

Copied: sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp (from r76030, /sandbox/closure/boost/closure/aux_/macro/code_/binding.hpp)
==============================================================================
--- /sandbox/closure/boost/closure/aux_/macro/code_/binding.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/bind.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,201 +4,224 @@
 // 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_LOCAL_AUX_FUNCTION_CODE_BINDING_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_HPP_
+#ifndef BOOST_CLOSURE_AUX_CODE_BIND_HPP_
+#define BOOST_CLOSURE_AUX_CODE_BIND_HPP_
 
-#include "bind_this.hpp"
-#include "../../symbol.hpp"
-#include "../../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include "../../preprocessor/sign/params_any_bind.hpp"
-#include "../../preprocessor/sign/param_any_bind.hpp"
-#include "../../../../utility/identity.hpp"
+/** @todo uncomment these includes */
+#include <boost/closure/aux_/symbol.hpp>
+#include <boost/closure/aux_/preprocessor/traits/bind.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_binds.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/utility/identity.hpp>
+//#include <boost/scope_exit.hpp>
 #include <boost/type_traits/remove_reference.hpp>
-#include <boost/preprocessor/control/iif.hpp>
+#include <boost/type_traits/function_traits.hpp>
 #include <boost/preprocessor/control/expr_iif.hpp>
-#include <boost/preprocessor/list/adt.hpp> // For `IS_CONS`.
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/facilities/identity.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/list/adt.hpp>
 #include <boost/preprocessor/list/for_each_i.hpp>
-#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/append.hpp>
 
 // PRIVATE //
 
-// Adapted from `BOOST_SCOPE_EXIT_AUX_TAG_DECL()` (not for `this`).
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_TAG_DECL_TYPED_( \
- r, id, i, typed_var) \
- typedef void (*BOOST_SCOPE_EXIT_AUX_TAG(id, i))(typed_var);
+#define BOOST_CLOSURE_AUX_CODE_BIND_PARAMS_VAR_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (params)(id) )
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_TAG_DECL_(r, id, i, bind) \
+#define BOOST_CLOSURE_AUX_CODE_BIND_TAG_DECL_(r, id, i, bind_traits) \
     BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL()` (not for `this`).
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_TYPED_( \
- r, id_typename, i, bind) \
- typedef \
+#define BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_TYPED_( \
+ r, id, typename01, i, bind_traits) \
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
         /* remove ref because typed var can have & prefix */ \
- BOOST_PP_TUPLE_ELEM(2, 1, id_typename) /* eventual typename */ \
- ::boost::remove_reference< \
- BOOST_PP_TUPLE_ELEM(2, 1, id_typename) /* eventual typename */ \
+ ::boost::remove_reference< BOOST_PP_EXPR_IIF(typename01, typename) \
             ::boost::function_traits< \
- /* instead of using Boost.Typeof, get bind type from func */ \
- /* type `void (bind_type [&] bind_name)` */ \
- void (BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITH_TYPE(bind)) \
+ /* instead of using Boost.Typeof, get bind type as 1st */ \
+ /* argument type of func type `void (type_ [&] var_)` */ \
+ void ( BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITH_TYPE( \
+ bind_traits) ) \
>::arg1_type \
>::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
- i, BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind)) \
- ; /* end typedef */
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_( \
- r, id_typename, i, bind) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HAS_TYPE(bind), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_TYPED_ \
+ BOOST_SCOPE_EXIT_AUX_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, \
+ ( \
+ id \
+ , \
+ /* ScopeExit expects typename or EMPTY() here */ \
+ BOOST_PP_IIF(typename01, \
+ BOOST_PP_IDENTITY(typename) \
+ , \
+ BOOST_PP_EMPTY \
+ )() \
+ ), \
+ i, BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
+
+#define BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_( \
+ r, id_typename, i, bind_traits) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITH_TYPE(bind_traits)), \
+ BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_DEDUCED_ \
     , \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL \
- )(r, id_typename, i, \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HAS_TYPE(bind), \
- bind BOOST_PP_TUPLE_EAT(1) \
- , \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE \
- )(bind) \
- )
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_DECL_( \
- r, id_typename, i, bind) \
- BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, id_typename, i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_DECL_( \
- r, id, typename_keyword, i, var) \
- typename_keyword \
+ BOOST_CLOSURE_AUX_CODE_BIND_CAPTURE_DECL_TYPED_ \
+ )(r, BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
+ BOOST_PP_TUPLE_ELEM(2, 1, id_typename), i, bind_traits)
+
+#define BOOST_CLOSURE_AUX_CODE_BIND_PARAM_DECL_( \
+ r, id_typename, i, bind_traits) \
+ BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, \
+ ( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_typename) \
+ , \
+ /* ScopeExit expects typename or EMPTY() here */ \
+ BOOST_PP_IIF(BOOST_PP_TUPLE_ELEM(2, 1, id_typename), \
+ BOOST_PP_IDENTITY(typename) \
+ , \
+ BOOST_PP_EMPTY \
+ )() \
+ ), \
+ i, BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
+
+#define BOOST_CLOSURE_AUX_CODE_BIND_MEMBER_DECL_VAR_( \
+ 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::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_AUX_PARAM(id, i, var);
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_(r, id_typename, i, bind) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_DECL_(r, \
+#define BOOST_CLOSURE_AUX_CODE_BIND_MEMBER_DECL_( \
+ r, id_typename, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_BIND_MEMBER_DECL_VAR_(r, \
             BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
- BOOST_PP_TUPLE_ELEM(2, 1, id_typename), i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
+ BOOST_PP_TUPLE_ELEM(2, 1, id_typename), \
+ i, BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_INIT_(r, id, i, bind) \
+#define BOOST_CLOSURE_AUX_CODE_BIND_PARAM_INIT_(r, id, i, bind_traits) \
     BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_WITH_( \
- id, all_bind_this_types) \
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_WITHOUT_( \
- id, all_bind_this_types) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id);
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITH_( \
- all_bind_this_types) \
- typedef BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_TYPE( \
- BOOST_PP_LIST_FIRST(all_bind_this_types))
+#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_(all_bind_this_types) \
+ typedef BOOST_CLOSURE_AUX_PP_BIND_TRAITS_THIS_TYPE(BOOST_PP_LIST_FIRST( \
+ all_bind_this_types))
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITHOUT_( \
- all_bind_this_types) \
+#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_(all_bind_this_types) \
     BOOST_SCOPE_EXIT_TYPEDEF_TYPEOF_THIS()
 
-// Precondition: all_bind_this_type is list with 1 elem (possibly PP_EMPTY).
-// Otherwise got a parsing error before getting here.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPE_( \
- id, all_bind_this_types) \
- /* typedef ... */ \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_HAS_TYPE( \
- BOOST_PP_LIST_FIRST(all_bind_this_types)), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITH_ \
+#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_(id, all_bind_this_types) \
+ /* typedef type_ */ \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(BOOST_CLOSURE_AUX_PP_BIND_TRAITS_THIS_TYPE( \
+ /* all_bind_this_type is list with 1 elem (possibly PP_EMPTY), */ \
+ /* otherwise got a pp-parsing error before getting here */ \
+ BOOST_PP_LIST_FIRST(all_bind_this_types))), \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_DEDUCED_ \
     , \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITHOUT_ \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_TYPED_ \
     )(all_bind_this_types) \
- /* ... this_type ## id */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- ; /* end typedef */
+ /* this_type ## id */ \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+ ; /* close typedef */
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_IMPL()`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_WITH_TAGS_SEQ_( \
- all_binds, all_bind_this_types, id, typename_keyword) \
+#define BOOST_CLOSURE_AUX_CODE_BIND_ALL_( \
+ all_binds, all_bind_this_types, id, typename01) \
     /* binding tags */ \
     BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPE_ \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPEDEF_ \
     , \
         BOOST_PP_TUPLE_EAT(2) \
     )(id, all_bind_this_types) \
- BOOST_PP_LIST_FOR_EACH_I(BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_TAG_DECL_, \
- id, all_binds) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_, \
- (id, typename_keyword), all_binds) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_BIND_TAG_DECL_, id, \
+ all_binds) \
+ 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) { \
         BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_NAME; \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_VAR; \
         ) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_DECL_, \
- (id, typename_keyword), all_binds) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_, \
- (id, typename_keyword), all_binds) \
- } BOOST_LOCAL_AUX_SYMBOL_PARAMS_LOCAL_VARIABLE_NAME(id) = \
- /* NOTE: there is no way to wrap member initializer commas within paren */ \
- /* so you must handle these commas manually if expanding this macro */ \
- /* within another macro */ \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_BIND_PARAM_DECL_, \
+ (id, typename01), all_binds) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_BIND_MEMBER_DECL_, \
+ (id, typename01), all_binds) \
+ } BOOST_CLOSURE_AUX_CODE_BIND_PARAMS_VAR_(id) = \
+ /* NOTE: there is no way to wrap member initializer commas within */ \
+ /* parenthesis so you must handle these commas manually if expanding */ \
+ /* this macro within another macro */ \
     { \
         /* initialize the struct with param values to bind */ \
- BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), this) \
- BOOST_PP_COMMA_IF(BOOST_PP_BITAND( \
- BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_PP_LIST_IS_CONS(all_binds))) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_INIT_, \
+ BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
+ this) /* here name `this` access object at enclosing scope */ \
+ BOOST_PP_COMMA_IF(BOOST_PP_LIST_IS_CONS(BOOST_PP_LIST_APPEND( \
+ all_bind_this_types, all_binds))) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_BIND_PARAM_INIT_, \
                 id, all_binds) \
     };
 
-// Assume has some bind param.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_( \
- sign_params, id, typename_keyword) \
+#define BOOST_CLOSURE_AUX_CODE_BIND_(decl_traits, id, typename01) \
     /* has some bind param then all bind names is never empty nil-seq */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_WITH_TAGS_SEQ_( \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ALL_BIND_WITHOUT_THIS(sign_params), \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ALL_BIND_THIS_TYPE(sign_params), \
- id, typename_keyword)
+ BOOST_CLOSURE_AUX_CODE_BIND_ALL_( \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits)),\
+ BOOST_PP_LIST_APPEND( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
+ decl_traits), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits)), \
+ id, typename01)
 
 // PUBLIC //
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING( \
- sign_params, id, typename_keyword) \
- /* The binding data structures must be declared and initialized (to */ \
+#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (this_type)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_BIND_THIS_VAR \
+ BOOST_CLOSURE_AUX_SYMBOL( (this_var) )
+
+#define BOOST_CLOSURE_AUX_CODE_BIND(decl_traits, id, typename01) \
+ /* the binding data structures must be declared and initialized (to */ \
     /* empty structs, so hopefully the compiler will optimize away the */ \
     /* no-op code) even when there is no bound param because these structs */ \
- /* are used to init `...args.value` which is always used by the `NAME` */ \
+ /* are used to init `...args.value` which is always used by the `END` */ \
     /* macro later because this macro does not know if there are bound */ \
     /* params or not */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_(sign_params, id, typename_keyword) \
+ BOOST_CLOSURE_AUX_CODE_BIND_(decl_traits, id, typename01) \
     /* 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); */ \
     /* which is a no-op */ \
- boost::scope_exit::aux::declared< boost::scope_exit::aux::resolve< \
+ ::boost::scope_exit::aux::declared< boost::scope_exit::aux::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 */ \
         /* does not allow for nesting because local variables cannot be */ \
         /* used in nested code blocks) */ \
- sizeof(BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME) \
- >::cmp1<0>::cmp2 > BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME; \
+ sizeof(BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR) \
+ >::cmp1<0>::cmp2 > BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR; \
     /* stores bound types/values into `...args` variable (args variable */ \
     /* can be accessed by `NAME` macro because doesn't use __LINE__ id) */ \
- BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME.value = \
- &BOOST_LOCAL_AUX_SYMBOL_PARAMS_LOCAL_VARIABLE_NAME(id);
+ BOOST_CLOSURE_AUX_CLOSURE_ARGS_VAR.value = \
+ &BOOST_CLOSURE_AUX_CODE_BIND_PARAMS_VAR_(id);
 
 #endif // #include guard
 

Deleted: sandbox/closure/boost/closure/aux_/macro/code_/bind_this.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/bind_this.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
+++ (empty file)
@@ -1,34 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to the Boost Software
-// 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_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_HPP_
-
-#include "../../symbol.hpp"
-#include "../../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include <boost/detail/preprocessor/keyword/this.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-
-// PUBLIC //
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- BOOST_PP_CAT(se_this_type, id) // Using ScopeExit prefix `se_...`.
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_NAME \
- se_this // Using ScopeExit prefix `se_...`.
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_RENAME(param_name) \
- /* can't use `PP_KEYWORD_IS_THIS_FRONT()` because some `param_name` */ \
- /* might start with non-alphanumeric symbol `&` (but never for `this`) */ \
- BOOST_PP_IIF(BOOST_DETAIL_PP_KEYWORD_IS_THIS_BACK(param_name), \
- BOOST_LOCAL_AUX_SYMBOL_THIS_PARAM_NAME \
- , \
- param_name \
- )
-
-#endif // #include guard
-

Deleted: sandbox/closure/boost/closure/aux_/macro/code_/binding.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/binding.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
+++ (empty file)
@@ -1,204 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to the Boost Software
-// 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_LOCAL_AUX_FUNCTION_CODE_BINDING_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_HPP_
-
-#include "bind_this.hpp"
-#include "../../symbol.hpp"
-#include "../../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include "../../preprocessor/sign/params_any_bind.hpp"
-#include "../../preprocessor/sign/param_any_bind.hpp"
-#include "../../../../utility/identity.hpp"
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/control/expr_iif.hpp>
-#include <boost/preprocessor/list/adt.hpp> // For `IS_CONS`.
-#include <boost/preprocessor/list/for_each_i.hpp>
-#include <boost/preprocessor/cat.hpp>
-
-// PRIVATE //
-
-// Adapted from `BOOST_SCOPE_EXIT_AUX_TAG_DECL()` (not for `this`).
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_TAG_DECL_TYPED_( \
- r, id, i, typed_var) \
- typedef void (*BOOST_SCOPE_EXIT_AUX_TAG(id, i))(typed_var);
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_TAG_DECL_(r, id, i, bind) \
- BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
-
-// Adapted from `BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL()` (not for `this`).
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_TYPED_( \
- r, id_typename, i, bind) \
- typedef \
- /* remove ref because typed var can have & prefix */ \
- BOOST_PP_TUPLE_ELEM(2, 1, id_typename) /* eventual typename */ \
- ::boost::remove_reference< \
- BOOST_PP_TUPLE_ELEM(2, 1, id_typename) /* eventual typename */ \
- ::boost::function_traits< \
- /* instead of using Boost.Typeof, get bind type from func */ \
- /* type `void (bind_type [&] bind_name)` */ \
- void (BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITH_TYPE(bind)) \
- >::arg1_type \
- >::type \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
- i, BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind)) \
- ; /* end typedef */
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_( \
- r, id_typename, i, bind) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HAS_TYPE(bind), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_TYPED_ \
- , \
- BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL \
- )(r, id_typename, i, \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HAS_TYPE(bind), \
- bind BOOST_PP_TUPLE_EAT(1) \
- , \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE \
- )(bind) \
- )
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_DECL_( \
- r, id_typename, i, bind) \
- BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, id_typename, i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_DECL_( \
- r, id, typename_keyword, i, var) \
- typename_keyword \
- 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_AUX_PARAM(id,i,var);
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_(r, id_typename, i, bind) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_DECL_(r, \
- BOOST_PP_TUPLE_ELEM(2, 0, id_typename), \
- BOOST_PP_TUPLE_ELEM(2, 1, id_typename), i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_INIT_(r, id, i, bind) \
- BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(bind))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_WITH_( \
- id, all_bind_this_types) \
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_WITHOUT_( \
- id, all_bind_this_types) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id);
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITH_( \
- all_bind_this_types) \
- typedef BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_TYPE( \
- BOOST_PP_LIST_FIRST(all_bind_this_types))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITHOUT_( \
- all_bind_this_types) \
- BOOST_SCOPE_EXIT_TYPEDEF_TYPEOF_THIS()
-
-// Precondition: all_bind_this_type is list with 1 elem (possibly PP_EMPTY).
-// Otherwise got a parsing error before getting here.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPE_( \
- id, all_bind_this_types) \
- /* typedef ... */ \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_HAS_TYPE( \
- BOOST_PP_LIST_FIRST(all_bind_this_types)), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITH_ \
- , \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPEDEF_WITHOUT_ \
- )(all_bind_this_types) \
- /* ... this_type ## id */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- ; /* end typedef */
-
-// Adapted from `BOOST_SCOPE_EXIT_AUX_IMPL()`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_WITH_TAGS_SEQ_( \
- all_binds, all_bind_this_types, id, typename_keyword) \
- /* binding tags */ \
- BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_THIS_TYPE_ \
- , \
- BOOST_PP_TUPLE_EAT(2) \
- )(id, all_bind_this_types) \
- BOOST_PP_LIST_FOR_EACH_I(BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_TAG_DECL_, \
- id, all_binds) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_CAPTURE_DECL_, \
- (id, typename_keyword), all_binds) \
- /* binding class */ \
- struct BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) { \
- BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_NAME; \
- ) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_DECL_, \
- (id, typename_keyword), all_binds) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_MEMBER_, \
- (id, typename_keyword), all_binds) \
- } BOOST_LOCAL_AUX_SYMBOL_PARAMS_LOCAL_VARIABLE_NAME(id) = \
- /* NOTE: there is no way to wrap member initializer commas within paren */ \
- /* so you must handle these commas manually if expanding this macro */ \
- /* within another macro */ \
- { \
- /* initialize the struct with param values to bind */ \
- BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(all_bind_this_types), this) \
- BOOST_PP_COMMA_IF(BOOST_PP_BITAND( \
- BOOST_PP_LIST_IS_CONS(all_bind_this_types), \
- BOOST_PP_LIST_IS_CONS(all_binds))) \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_PARAM_INIT_, \
- id, all_binds) \
- };
-
-// Assume has some bind param.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_( \
- sign_params, id, typename_keyword) \
- /* has some bind param then all bind names is never empty nil-seq */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_WITH_TAGS_SEQ_( \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ALL_BIND_WITHOUT_THIS(sign_params), \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_ALL_BIND_THIS_TYPE(sign_params), \
- id, typename_keyword)
-
-// PUBLIC //
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING( \
- sign_params, id, typename_keyword) \
- /* The binding data structures must be declared and initialized (to */ \
- /* empty structs, so hopefully the compiler will optimize away the */ \
- /* no-op code) even when there is no bound param because these structs */ \
- /* are used to init `...args.value` which is always used by the `NAME` */ \
- /* macro later because this macro does not know if there are bound */ \
- /* params or not */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BINDING_(sign_params, id, typename_keyword) \
- /* 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); */ \
- /* which is a no-op */ \
- boost::scope_exit::aux::declared< boost::scope_exit::aux::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 */ \
- /* does not allow for nesting because local variables cannot be */ \
- /* used in nested code blocks) */ \
- sizeof(BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME) \
- >::cmp1<0>::cmp2 > BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME; \
- /* stores bound types/values into `...args` variable (args variable */ \
- /* can be accessed by `NAME` macro because doesn't use __LINE__ id) */ \
- BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME.value = \
- &BOOST_LOCAL_AUX_SYMBOL_PARAMS_LOCAL_VARIABLE_NAME(id);
-
-#endif // #include guard
-

Deleted: sandbox/closure/boost/closure/aux_/macro/code_/deduce_result_type.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/deduce_result_type.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
+++ (empty file)
@@ -1,50 +0,0 @@
-
-// Copyright (C) 2009-2011 Lorenzo Caminiti
-// Use, modification, and distribution is subject to the Boost Software
-// 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_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE_HPP_
-
-#include "../../symbol.hpp"
-#include "../../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/type_traits/function_traits.hpp>
-#include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/facilities/is_empty.hpp>
-
-// This must follow the result type.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE(id, is_template) \
- /* result type here */ (*BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id))(); \
- /* the many tagging, wrapping, etc that follow are taken from */ \
- /* Boost.ScopeExit type deduction mechanism and they are necessary */ \
- /* within template on GCC to work around a compiler internal error */ \
- typedef void (*BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_TAG(id))( \
- int BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id)); \
- typedef BOOST_PP_IIF(is_template, \
- BOOST_TYPEOF_TPL \
- , \
- BOOST_TYPEOF \
- )(boost::scope_exit::aux::wrap( \
- boost::scope_exit::aux::deref( \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id), \
- (BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_TAG(id))0))) \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_WRAP(id); \
- typedef BOOST_PP_EXPR_IIF(is_template, typename) \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_WRAP(id)::type \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_CAPTURE(id); \
- struct BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_PARAMS(id) { \
- typedef BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_CAPTURE(id) \
- function_ptr_type;\
- }; \
- typedef BOOST_PP_EXPR_IIF(is_template, typename) boost::remove_pointer< \
- BOOST_PP_EXPR_IIF(is_template, typename) \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_PARAMS(id)::function_ptr_type \
- >::type BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC_TYPE(id); \
- typedef BOOST_PP_EXPR_IIF(is_template, typename) boost::function_traits< \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC_TYPE(id)>::result_type \
- BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id);
-
-#endif // #include guard
-

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 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,240 +4,271 @@
 // 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_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_HPP_
+#ifndef BOOST_CLOSURE_AUX_CODE_FUNCTOR_HPP_
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_HPP_
 
-#include "bind_this.hpp"
-#include "../../symbol.hpp"
-#include "../../preprocessor/sign/params_unbind.hpp"
-#include "../../preprocessor/sign/params_const_bind.hpp"
-#include "../../preprocessor/sign/params_bind.hpp"
-#include "../../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
-#include "../../type_traits/add_pointed_const.hpp"
-#include "../../function.hpp"
-#include "../../../config.hpp"
-#include "../../../../utility/identity.hpp"
-#include <boost/detail/preprocessor/keyword/auto.hpp>
-#include <boost/detail/preprocessor/keyword/register.hpp>
+/** @todo uncomment these includes */
+#include <boost/closure/aux_/symbol.hpp>
+//#include <boost/closure/aux_/function.hpp>
+#include <boost/closure/aux_/add_pointed_const.hpp>
+#include <boost/closure/aux_/macro/closure.hpp>
+#include <boost/closure/aux_/macro/closure_typeof.hpp>
+#include <boost/closure/aux_/macro/code_/result.hpp>
+#include <boost/closure/aux_/macro/code_/bind.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_params.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_binds.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_const_binds.hpp>
+#include <boost/closure/detail/preprocessor/keyword/auto.hpp>
+#include <boost/closure/detail/preprocessor/keyword/register.hpp>
+#include <boost/closure/detail/preprocessor/keyword/this.hpp>
+#include <boost/utility/identity.hpp>
+//#include <boost/scope_exit.hpp>
 #include <boost/type_traits/add_const.hpp>
+#include <boost/preprocessor/cat.hpp>
 #include <boost/preprocessor/punctuation/comma_if.hpp>
-#include <boost/preprocessor/logical/bitand.hpp>
-#include <boost/preprocessor/logical/bitand.hpp>
-#include <boost/preprocessor/logical/bitor.hpp>
-#include <boost/preprocessor/logical/or.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/facilities/empty.hpp>
-#include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/logical/bitor.hpp>
+#include <boost/preprocessor/logical/bitand.hpp>
+#include <boost/preprocessor/logical/compl.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
 #include <boost/preprocessor/tuple/eat.hpp>
-#include <boost/preprocessor/list/adt.hpp> // For `IS_CONS`.
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/size.hpp>
 #include <boost/preprocessor/list/for_each_i.hpp>
+#include <boost/preprocessor/list/first_n.hpp>
 
 // PRIVATE //
 
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (functor)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_TYPE_ \
+ BOOST_CLOSURE_AUX_SYMBOL( (function_type) )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BODY_FUNC_ \
+ BOOST_CLOSURE_AUX_SYMBOL( (body) )
+
 // Unbind parameters.
 
 // i: 1 for 1st param, 2 for 2nd, ... (start from 1 not 0).
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_NAME_(i) \
- /* this must be a generic parameter name because unbind type and name */ \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(i) \
+ /* this must be a generic parameter name because type and name */ \
     /* are not separate tokens in the macro syntax so name is not available */ \
     /* separately from its type */ \
     BOOST_PP_CAT(arg, i)
 
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_( \
+ r, unused, i, param_traits) \
+ BOOST_PP_COMMA_IF(i) /* enumeration commas */ \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
+
 // i: 1 for 1st param, 2 for 2nd, ... (start from 1 not 0).
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_TYPE_( \
- typename_keyword, i) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, i) \
     /* the parameter type must be accessed using function traits from */ \
     /* function type because it is not available to the macro syntax */ \
     /* separately from the parameter name */ \
- typename_keyword \
- BOOST_PP_CAT(BOOST_PP_CAT(::boost::function_traits< \
- BOOST_LOCAL_AUX_SYMBOL_FUNCTION_TYPE>::arg, i), _type) \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::function_traits< \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_TYPE_ \
+ >::BOOST_PP_CAT(BOOST_PP_CAT(arg, i), _type) \
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_DECL_( \
- r, typename_keyword, i, param) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_( \
+ r, typename01, i, param_traits) \
     BOOST_PP_COMMA_IF(i) \
- typename_keyword \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
     ::boost::call_traits< \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_TYPE_( \
- typename_keyword, BOOST_PP_INC(i))>::param_type \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_NAME_(BOOST_PP_INC(i))
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, \
+ BOOST_PP_INC(i)) \
+ >::param_type \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
+
+// Precondition: !EMPTY(DEFAULT(param_traits))
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_(param_traits) \
+ = BOOST_CLOSURE_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT( \
+ BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits))
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_NAME_ENUM_( \
- r, unused, i, param) \
- BOOST_PP_COMMA_IF(i) /* enumeration commas */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_NAME_(BOOST_PP_INC(i))
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_DECL_( \
- r, unused, i, param) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_( \
+ r, default01, i, param_traits) \
     BOOST_PP_COMMA_IF(i) \
- BOOST_DETAIL_PP_KEYWORD_AUTO_REMOVE_BACK( \
- BOOST_DETAIL_PP_KEYWORD_REGISTER_REMOVE_BACK( \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_DECL(param) \
- ) \
- )
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_DECL_WITH_DEFAULT_( \
- r, unused, i, param) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_DECL_(z, unused, i, param) \
- BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_HAS_DEFAULT( \
- param), \
- = BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_DEFAULT \
- , \
- BOOST_PP_TUPLE_EAT(1) \
- )(param)
+ BOOST_CLOSURE_DETAIL_PP_KEYWORD_AUTO_REMOVE_BACK( \
+ BOOST_CLOSURE_DETAIL_PP_KEYWORD_REGISTER_REMOVE_BACK( \
+ BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_DECL(param_traits) \
+ )) \
+ BOOST_PP_IIF(BOOST_PP_COMPL(default01), \
+ BOOST_PP_TUPLE_EAT(1) /* without default */ \
+ , BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
+ BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits)), \
+ BOOST_PP_TUPLE_EAT(1) /* has no default */ \
+ , /* else, with default and has default */ \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_ \
+ ))(param_traits)
 
 // Bound parameters.
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_PARAM_ \
- bindings /* constructor parameter `void*` bindings pointer */
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAMS_ \
+ bind_params /* constructor void* param */
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_(i) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_(i) \
     /* named `bind0`, `bind1`, ... */ \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(bind, i))
+ BOOST_CLOSURE_AUX_SYMBOL( (bind)(i) )
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(bind_this)
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+ BOOST_CLOSURE_AUX_SYMBOL( (bind_this) )
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_TYPE_( \
- id_typename_offset, i, var) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_TYPE_( \
+ id_typename_offset, i, bind_traits) \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(3, 1, id_typename_offset), typename) \
     BOOST_SCOPE_EXIT_AUX_PARAMS_T( \
             BOOST_PP_TUPLE_ELEM(3, 0, id_typename_offset)):: \
     BOOST_SCOPE_EXIT_AUX_PARAM_T( \
             BOOST_PP_TUPLE_ELEM(3, 0, id_typename_offset), \
             BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(3, 2, id_typename_offset)),\
- var)
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_( \
- r, offset, i, var) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_( \
+ r, offset, i, bind_traits) \
     BOOST_PP_COMMA_IF(i) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
             BOOST_PP_ADD(offset, i))
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_ARG_DECL()`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
- r, id_typename_offset, i, var, is_const) \
- BOOST_PP_TUPLE_ELEM(3, 1, id_typename_offset) /* eventual typename */ \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+ r, id_typename_offset, i, bind_traits, is_const) \
+ /* IMPORTANT: here can't use `PP_KEYWORD_IS_THIS_FRONT()` because some */ \
+ /* `param_name` might start with non-alphanumeric symbol `&` (but that */ \
+ /* is never the case for `this`) */ \
+ BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(3, 1, id_typename_offset), typename) \
     BOOST_PP_EXPR_IF(is_const, \
- BOOST_PP_IIF( \
- BOOST_DETAIL_PP_KEYWORD_IS_THIS_BACK(var), \
+ BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits)), \
             ::boost::local::aux::add_pointed_const< /* pointed obj const */ \
         , \
             ::boost::add_const< /* outer type const */ \
         ) \
- BOOST_PP_TUPLE_ELEM(3, 1, id_typename_offset) /* eventual typename */ \
     ) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_TYPE_( \
- id_typename_offset, i, var) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_TYPE_(id_typename_offset, \
+ i, bind_traits) \
     BOOST_PP_EXPR_IF(is_const, >::type) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_RENAME(var)
+ BOOST_PP_IIF(BOOST_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
+ bind_traits)), \
+ this_ BOOST_PP_TUPLE_EAT(1) \
+ , \
+ BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE \
+ )(bind_traits)
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_ARG_DECL()`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
- r, id_typename_offset, i, var, is_const) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
+ r, id_typename_offset, i, bind_traits, is_const) \
     BOOST_PP_COMMA_IF(i) /* enumeration commas */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
- r, id_typename_offset, i, var, is_const)
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+ r, id_typename_offset, i, bind_traits, is_const)
     
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_DECL_( \
- r, id_typename_offset, i, var) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
- r, id_typename_offset, i, var, 0 /* do not force const */)
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CONST_BIND_DECL_( \
- r, id_typename_offset, i, var) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
- r, id_typename_offset, i, var, 1 /* force const */)
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
- r, id_typename_offset, i, var, is_const) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_DECL_ENUM_( \
+ r, id_typename_offset, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
+ r, id_typename_offset, i, bind_traits, 0 /* do not force const */)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CONST_BIND_DECL_ENUM_( \
+ r, id_typename_offset, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
+ r, id_typename_offset, i, bind_traits, 1 /* force const */)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
+ r, id_typename_offset, i, bind_traits, is_const) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
             r, id_typename_offset, i, \
             & /* all bind member vars are refs to ScopeExit struct members */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_(\
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
                     BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(3, 2, \
                             id_typename_offset))), \
             is_const) \
     ; /* end member variable declaration */
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_MEMBER_DECL_( \
- r, id_typename_offset, i, var) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
- r, id_typename_offset, i, var, 0 /* do not force const */) \
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CONST_BIND_MEMBER_DECL_( \
- r, id_typename_offset, i, var) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
- r, id_typename_offset, i, var, 1 /* force const */) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_DECL_( \
+ r, id_typename_offset, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
+ r, id_typename_offset, i, bind_traits, 0 /* do not force const */)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CONST_BIND_MEMBER_DECL_( \
+ r, id_typename_offset, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
+ r, id_typename_offset, i, bind_traits, 1 /* force const */)
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_ARG()`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_( \
- r, id_offset, i, var) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_( \
+ r, id_offset, i, bind_traits) \
     BOOST_PP_COMMA_IF(i) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
             BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset))) \
     ( /* member variable initialization */ \
- static_cast< BOOST_SCOPE_EXIT_AUX_PARAMS_T( \
- BOOST_PP_TUPLE_ELEM(2, 0, id_offset))* >( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_PARAM_)-> \
+ static_cast< \
+ BOOST_SCOPE_EXIT_AUX_PARAMS_T( \
+ BOOST_PP_TUPLE_ELEM(2, 0, id_offset))* \
+ >(BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAMS_)-> \
         BOOST_SCOPE_EXIT_AUX_PARAM( \
- BOOST_PP_TUPLE_ELEM(2, 0, id_offset), \
- BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset)), \
- var).value \
+ 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) \
+ ).value \
     )
 
 // Typeof type-definitions.
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
- r, id_typename_offset, i, var, is_const) \
- typedef \
- /* the type with the special typeof name */ \
- BOOST_LOCAL_AUX_SYMBOL_TYPEOF_TYPE( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
- r, id_typename_offset, i, var, is_const) \
- ) ; /* end typedef */
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_TYPEDEF_( \
- r, id_typename_offset, i, var) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
- r, id_typename_offset, i, var, 0 /* do not add const */)
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CONST_TYPEDEF_( \
- r, id_typename_offset, i, var) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
- r, id_typename_offset, i, var, 1 /* add const */)
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
+ r, id_typename_offset, i, bind_traits, is_const) \
+ typedef /* the type with the special typeof name */ \
+ BOOST_CLOSURE_AUX_CLOSURE_TYPEOF_TYPE( \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+ r, id_typename_offset, i, bind_traits, is_const) \
+ ) \
+ ; /* end typedef */
 
-// Template parameter function type `F`.
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPEDEF_( \
+ r, id_typename_offset, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
+ r, id_typename_offset, i, bind_traits, 0 /* do not add const */)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CONST_TYPEDEF_( \
+ r, id_typename_offset, i, bind_traits) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
+ r, id_typename_offset, i, bind_traits, 1 /* add const */)
 
 // Expand to the function type `R (A1, ...)`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_F_( \
- sign_params, id, has_type, type_name) \
- BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id) \
- BOOST_PP_EXPR_IIF(has_type, (type_name) ) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_( \
+ decl_traits, id, has_type, function_type) \
+ BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) \
+ BOOST_PP_EXPR_IIF(has_type, (function_type) ) \
     ( \
         BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_DECL_, ~, \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(sign_params)) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_, \
+ 0, /* without defaults */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits)) \
     )
 
 // Functor call operations.
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CALL_(z, \
- defaults_n, \
- sign_params, \
- unbinds, \
- const_binds, has_const_bind_this, \
- binds, has_bind_this, \
- id, typename_keyword) \
- inline BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id) operator()( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_(z, defaults_n, decl_traits, \
+ params, const_binds, has_const_bind_this, binds, has_bind_this, \
+ id, typename01) \
+ inline BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) operator()( \
         BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_DECL_, \
- typename_keyword, unbinds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
+ typename01, params) \
     ) const { \
         /* just forward call to member function with local func name */ \
- return BOOST_LOCAL_AUX_SYMBOL_BODY_FUNCTION_NAME( \
+ return BOOST_CLOSURE_AUX_CODE_FUNCTOR_BODY_FUNC_( \
             BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_, \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_, \
                     0 /* no offset */, const_binds) \
             /* pass plain binds */ \
             BOOST_PP_COMMA_IF( \
@@ -247,9 +278,8 @@
                 ) \
             ) \
             BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_, \
- /* offset param index of # of preceeding */ \
- /* const-bind params (could be 0)*/ \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_, \
+ /* offset index of # const-binds (could be 0) */ \
                     BOOST_PP_LIST_SIZE(const_binds), binds) \
             /* pass bind `this` */ \
             BOOST_PP_COMMA_IF( \
@@ -263,9 +293,9 @@
             ) \
             BOOST_PP_EXPR_IIF( \
                     BOOST_PP_BITOR(has_const_bind_this, has_bind_this), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
             ) \
- /* pass unbind params */ \
+ /* pass params */ \
             BOOST_PP_COMMA_IF( \
                 BOOST_PP_BITAND( \
                       BOOST_PP_BITOR( \
@@ -275,38 +305,33 @@
                           ) \
                         , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
                       ) \
- , BOOST_PP_LIST_IS_CONS(unbinds) \
+ , BOOST_PP_LIST_IS_CONS(params) \
                 ) \
             ) \
             BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_NAME_ENUM_, \
- ~, unbinds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
+ params) \
         ); \
     }
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_FUNC_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_( \
         z, defaults_n, unused) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(call, defaults_n))
+ BOOST_CLOSURE_AUX_SYMBOL( (call)(defaults_n) )
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_FUNC_PTR_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_ADDR_( \
         z, defaults_n, unused) \
- &BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_FUNC_( \
- z, defaults_n, unused)
+ &BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, unused)
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_(z, \
- defaults_n, \
- sign_params, \
- unbinds, \
- const_binds, has_const_bind_this, \
- binds, has_bind_this, \
- id, typename_keyword) \
- inline static BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_(z, defaults_n, \
+ decl_traits, params, const_binds, has_const_bind_this, binds, \
+ has_bind_this, id, typename01) \
+ inline static BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)( \
         void* object \
- BOOST_PP_COMMA_IF(BOOST_PP_LIST_IS_CONS(unbinds)) \
+ BOOST_PP_COMMA_IF(BOOST_PP_LIST_IS_CONS(params)) \
         BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_DECL_, \
- typename_keyword, unbinds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
+ typename01, params) \
     ) { \
         /* run-time: casting object to this class type and forward call to */ \
         /* `operator()` (this performs better than doing multiple casting */ \
@@ -316,52 +341,46 @@
         /* C++03 compliant because `static_cast` is not a template (even */ \
         /* if its syntax resembles a function template call) in fact even */ \
         /* in C is legal to cast to a local struct (using C-style casting) */ \
- return static_cast< BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_CLASS_NAME(id)* >( \
+ return static_cast< BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* >( \
                 object)->operator()( \
             BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_ARG_NAME_ENUM_, \
- ~, unbinds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
+ params) \
         ); \
     }
 
-// Return unbind params but without last (default) params specified by count.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_REMOVE_LAST_N_(n, \
- unbinds) \
- BOOST_PP_LIST_FIRST_N(BOOST_PP_SUB(BOOST_PP_LIST_SIZE(unbinds), n), \
- unbinds)
-
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CALL_FOR_DEFAULTS_(z, n, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_(z, n, \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     BOOST_PP_EXPAND( \
     BOOST_PP_TUPLE_ELEM(9, 0, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     ( z, n \
     , BOOST_PP_TUPLE_ELEM(9, 1, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
- /* remove last n default params */ \
- , BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_REMOVE_LAST_N_(n, \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ , BOOST_PP_LIST_FIRST_N(BOOST_PP_SUB(BOOST_PP_LIST_SIZE( \
+ /* remove last n default params */ \
         BOOST_PP_TUPLE_ELEM(9, 2, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
- ) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename)),\
+ n), \
+ BOOST_PP_TUPLE_ELEM(9, 2, \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename)) \
     , BOOST_PP_TUPLE_ELEM(9, 3, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     , BOOST_PP_TUPLE_ELEM(9, 4, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     , BOOST_PP_TUPLE_ELEM(9, 5, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     , BOOST_PP_TUPLE_ELEM(9, 6, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     , BOOST_PP_TUPLE_ELEM(9, 7, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     , BOOST_PP_TUPLE_ELEM(9, 8, \
- op_params_unbinds_constbinds_hasconstthis_binds_hasthis_id_typename) \
+ op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     ) /* end `op_macro(...)` */ \
     ) /* end expand */
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MEMBER_INITS_( \
- const_binds, has_const_bind_this, \
- binds, has_bind_this, \
- id) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MEMBER_INITS_( \
+ const_binds, has_const_bind_this, binds, has_bind_this, id) \
     BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(BOOST_PP_BITOR(BOOST_PP_BITOR( \
             BOOST_PP_LIST_IS_CONS(const_binds), BOOST_PP_LIST_IS_CONS(binds)), \
             has_bind_this), has_const_bind_this), \
@@ -369,9 +388,8 @@
     ) \
     /* init const binds */ \
     BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_,\
- (id, 0 /* no offset */), \
- const_binds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_, \
+ ( id, 0 /* no offset */ ), const_binds) \
     /* init plain binds */ \
     BOOST_PP_COMMA_IF( \
         BOOST_PP_BITAND( \
@@ -380,13 +398,9 @@
         ) \
     ) \
     BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_,\
- (id \
- /* offset param index of # of preceeding */ \
- /* const-bind params (could be 0)*/ \
- , BOOST_PP_LIST_SIZE(const_binds) \
- ), \
- binds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_, \
+ /* offset index of # of const-binds (could be 0) */ \
+ ( id, BOOST_PP_LIST_SIZE(const_binds) ), binds) \
     /* init `this` bind (const or not) */ \
     BOOST_PP_COMMA_IF( \
         BOOST_PP_BITAND( \
@@ -398,76 +412,74 @@
         ) \
     ) \
     BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_const_bind_this, has_bind_this), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_MEMBER_THIS_( \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_( \
             static_cast< BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)* >( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_PARAM_)-> \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_NAME \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAMS_)-> \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_VAR \
         ) \
     )
 
 // Functor class.
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_IMPL()`.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_(sign_params, \
- unbinds, default_count, \
- const_binds, has_const_bind_this, \
- binds, has_bind_this, \
- id, typename_keyword) \
- class BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_CLASS_NAME(id) \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_(decl_traits, params, default_count, \
+ const_binds, has_const_bind_this, binds, has_bind_this, \
+ id, typename01) \
+ class BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
     /* run-time: do not use base class to allow for compiler optimizations */ \
     { \
         /* function type */ \
- typedef BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_F_(sign_params, id, \
- 1 /* has type */, BOOST_LOCAL_AUX_SYMBOL_FUNCTION_TYPE); \
+ typedef BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_(sign_params, id, \
+ 1 /* has type */, BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_TYPE_); \
         /* functor type -- this type cannot have ID postfix because it is */ \
         /* used the `NAME` macro (this symbol is within functor class so */ \
         /* it does not have to have ID postfix) */ \
- typedef typename_keyword BOOST_IDENTITY_TYPE(( /* IDEN for tparam , */ \
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_IDENTITY_TYPE(( /* IDENTITY for template param comma */ \
                 ::boost::local::aux::function< \
- BOOST_LOCAL_AUX_SYMBOL_FUNCTION_TYPE, default_count \
- >)) BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE; \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_TYPE_ \
+ , default_count \
+ > \
+ )) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPE \
+ ; \
         /* typeof types -- these types are qualified with extra eventual */ \
         /* const and/or & if their variables are bound by const and/or & */ \
         /* (this is because it is not possible to strip the eventual & */ \
         /* given that the var name is always attached to the & symbol plus */ \
         /* programmers can always remove const& using type traits) */ \
         /* const bind typeof types */ \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CONST_TYPEDEF_, \
- (id, typename_keyword, 0 /* no offset */), \
- const_binds) \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_FUNCTOR_CONST_TYPEDEF_,\
+ (id, typename01, 0 /* no offset */), const_binds) \
         /* bind typeof types */ \
- BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_TYPEDEF_, \
- ( id, typename_keyword, \
- /* offset param index of # of preceeding */ \
- /* const-bindparams (could be 0)*/ \
- BOOST_PP_LIST_SIZE(const_binds)),\
- binds) \
- /* this (const or not) bind typeof type */ \
+ BOOST_PP_LIST_FOR_EACH_I(BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPEDEF_, \
+ /* offset index with # of preceding const-binds (if any) */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds) ), binds) \
+ /* const this... */ \
         BOOST_PP_EXPR_IIF(has_const_bind_this, \
- typedef \
- BOOST_LOCAL_AUX_SYMBOL_TYPEOF_TYPE( \
- typename_keyword ::boost::local::aux::add_pointed_const< \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- >::type this /* must not use `this_` for TYPEOF_TYPE */ \
- ) ; /* end typedef */ \
+ typedef BOOST_CLOSURE_AUX_CLOSURE_TYPEOF_TYPE( \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::local::aux::add_pointed_const< \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+ >::type \
+ this_ \
+ ) ; /* close typedef */ \
         ) \
+ /* ... or, non-const this */ \
         BOOST_PP_EXPR_IIF(has_bind_this, \
- typedef \
- BOOST_LOCAL_AUX_SYMBOL_TYPEOF_TYPE( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- this /* must not use `this_` for TYPEOF_TYPE */ \
- ) ; /* end typedef */ \
+ typedef BOOST_CLOSURE_AUX_CLOSURE_TYPEOF_TYPE( \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+ this_ \
+ ) ; /* close typedef */ \
         ) \
     public: \
         /* constructor */ \
- inline explicit BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_CLASS_NAME(id)( \
- void* BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_PARAM_) \
+ inline explicit BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)( \
+ void* BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAMS_) \
             /* NOTE: there is no way to wrap member initializer commas */ \
             /* within paren so you must handle these commas manually if */ \
             /* expanding this macro within another macro */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_MEMBER_INITS_(const_binds, \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_MEMBER_INITS_(const_binds, \
                     has_const_bind_this, binds, has_bind_this, id) \
         { /* do nothing */ } \
         /* run-time: implement `operator()` (and for all default params) so */ \
@@ -476,15 +488,15 @@
         BOOST_PP_REPEAT( \
             /* PP_INC to handle no dflt (EXPAND for MVSC) */ \
             BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
- ( BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CALL_, sign_params \
- , unbinds, const_binds, has_const_bind_this, binds \
- , has_bind_this, id, typename_keyword ) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
+ ( BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_, decl_traits, params \
+ , const_binds, has_const_bind_this, binds, has_bind_this, id \
+ , typename01 ) \
         ) \
         /* compliance: trick to pass this local class as a template param */ \
         /* on pure C++03 without non C++03 extension */ \
         /* performance: this trick introduced _one_ indirect function call */ \
- /* via a function pointer that cannot be inlined by the complier */ \
+ /* via a function pointer that is usually not inlined by compliers */ \
         /* thus increasing run-time (also another trick using a base */ \
         /* interface class was investigated but virtual calls also cannot */ \
         /* inlined plus they require virtual table lookups to the "virtual */ \
@@ -493,18 +505,18 @@
         BOOST_PP_REPEAT( \
             /* PP_INC to handle no dflt (EXPAND for MVSC) */ \
             BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
- ( BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_, sign_params \
- , unbinds, const_binds, has_const_bind_this, binds \
- , has_bind_this, id, typename_keyword ) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
+ ( BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_, decl_traits \
+ , params, const_binds, has_const_bind_this, binds, has_bind_this \
+ , id, typename01 ) \
         ) \
- inline static void BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME( \
- void* object, BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE& functor) { \
- functor.BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME(object, \
+ inline static void BOOST_CLOSURE_AUX_CODE_FUNCTOR_INIT_CALL_FUNC( \
+ void* object, BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPE& functor) { \
+ functor.BOOST_CLOSURE_AUX_CODE_FUNCTOR_INIT_CALL_FUNC(object, \
                 BOOST_PP_ENUM( \
                         /* PP_INC to handle no dflt (EXPAND for MVSC) */ \
                         BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_STATIC_CALL_FUNC_PTR_, \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_ADDR_, \
                         ~) \
             ); \
         } \
@@ -513,40 +525,34 @@
         /* references to the ScopeExit struct instead of accessing the bind */ \
         /* struct at each call (these mem refs are init by the constructor) */ \
         BOOST_PP_LIST_FOR_EACH_I( /* const bind member references */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CONST_BIND_MEMBER_DECL_,\
- (id, typename_keyword, 0 /* no offset */), \
- const_binds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_CONST_BIND_MEMBER_DECL_,\
+ ( id, typename01, 0 /* no offset */ ), const_binds) \
         BOOST_PP_LIST_FOR_EACH_I( /* bind member references */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_MEMBER_DECL_, \
- (id, typename_keyword, \
- /* offset param index of # of preceeding */ \
- /* const-bindparams (could be 0)*/ \
- BOOST_PP_LIST_SIZE(const_binds)),\
- binds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_DECL_, \
+ /* offset index of # of const-binds (could be 0) */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds) ), binds) \
         /* bind this const or not (pointed-const is not added here because */ \
         /* this is a reference, it is added to the this_ body param instead */ \
         BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
             & /* all bind member vars are refs to ScopeExit struct members */ \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
             ; /* end member variable declaration */ \
         ) \
         /* this decl allows for nesting (local functions, etc) as */ \
         /* 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_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME; \
+ boost::scope_exit::aux::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_`) */ \
- inline BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id) \
- BOOST_LOCAL_AUX_SYMBOL_BODY_FUNCTION_NAME( \
+ inline BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_BODY_FUNC_( \
                 /* const binds */ \
                 BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_CONST_BIND_DECL_,\
- (id, typename_keyword, 0 /* no offset */), \
- const_binds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_CONST_BIND_DECL_ENUM_,\
+ ( id, typename01, 0 /* no offset */ ), const_binds) \
                 /* plain binds */ \
                 BOOST_PP_COMMA_IF( \
                     BOOST_PP_BITAND( \
@@ -555,11 +561,9 @@
                     ) \
                 ) \
                 BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_BIND_DECL_, \
- ( id, typename_keyword, \
- /* offset param index of # of preceeding */ \
- /* const-bindparams (could be 0)*/ \
- BOOST_PP_LIST_SIZE(const_binds) ),\
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_DECL_ENUM_, \
+ /* offset index of # of const-binds (could be 0) */ \
+ ( id, typename01, BOOST_PP_LIST_SIZE(const_binds) ), \
                         binds) \
                 /* `this` bind */ \
                 BOOST_PP_COMMA_IF( \
@@ -571,19 +575,20 @@
                         , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
                     ) \
                 ) \
+ /* const pointer to const object */ \
                 BOOST_PP_EXPR_IIF(has_const_bind_this, \
- typename_keyword ::boost::local::aux::add_pointed_const< \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- >::type \
- /* const pointer to const object */ \
- const BOOST_LOCAL_CONFIG_THIS_PARAM_NAME \
+ BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::local::aux::add_pointed_const< \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+ >::type const \
+ this_ /* special name to access object this */ \
                 ) \
+ /* const pointer to non-const object */ \
                 BOOST_PP_EXPR_IIF(has_bind_this, \
- BOOST_LOCAL_AUX_FUNCTION_CODE_BIND_THIS_TYPE(id) \
- /* const pointer to non-const object */ \
- const BOOST_LOCAL_CONFIG_THIS_PARAM_NAME \
+ BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) const \
+ this_ /* special name to access object this */ \
                 ) \
- /* unbind params (last because they can have defaults) */ \
+ /* params (last because they can have defaults) */ \
                 BOOST_PP_COMMA_IF( \
                     BOOST_PP_BITAND( \
                           BOOST_PP_BITOR( \
@@ -594,38 +599,47 @@
                             , BOOST_PP_BITOR(has_const_bind_this, \
                                     has_bind_this) \
                           ) \
- , BOOST_PP_LIST_IS_CONS(unbinds) \
+ , BOOST_PP_LIST_IS_CONS(params) \
                     ) \
                 ) \
                 BOOST_PP_LIST_FOR_EACH_I( \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_UNBIND_DECL_WITH_DEFAULT_, \
- ~, unbinds) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_, \
+ 1 /* with defaults */, params) \
             ) /* end body function params */ \
             /* const member func so it cannot change obj (reassign member */ \
             /* var with local function name, etc) */ \
             const \
             /* user local function definition `{ ... }` will follow here */ \
- /* `NAME` macro will close function class decl `};` here */
+ /* `END` macro will close function class decl `};` here */
 
 // PUBLIC //
 
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR( \
- sign_params, id, typename_keyword) \
- BOOST_LOCAL_AUX_FUNCTION_CODE_FUNCTOR_(sign_params, \
- /* unbind params (might have defaults) */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND(sign_params), \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_COUNT_DEFAULTS(sign_params), \
- /* const bind vars (without `this`) */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_CONST_BIND_WITHOUT_TYPE( \
- sign_params), \
- /* eventual const bind `this` */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_HAVE_CONST_BIND_THIS(sign_params), \
- /* bind (not const) vars (without `this`) */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_BIND_WITHOUT_TYPE(sign_params), \
- /* eventual bind (not const) `this` */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_HAVE_BIND_THIS(sign_params), \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPE \
+ BOOST_CLOSURE_AUX_SYMBOL( (functor_type) )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_INIT_CALL_FUNC \
+ BOOST_CLOSURE_AUX_SYMBOL( (init_call) )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR(decl_traits, id, typename01) \
+ BOOST_CLOSURE_AUX_CODE_FUNCTOR_(decl_traits, \
+ /* params (might have defaults) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT(decl_traits),\
+ /* const bind vars (`this` excluded) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS_WITHOUT_TYPE( \
+ decl_traits), \
+ /* if const bind `this` is present */ \
+ BOOST_PP_LIST_IS_CONS( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
+ decl_traits)), \
+ /* bind (non-const) vars (`this` excluded) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS_WITHOUT_TYPE(decl_traits), \
+ /* if (non-const) bind `this` is present */ \
+ BOOST_PP_LIST_IS_CONS( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
+ decl_traits)), \
             /* etc */ \
- id, typename_keyword)
+ id, typename01)
 
 #endif // #include guard
 

Copied: sandbox/closure/boost/closure/aux_/macro/code_/result.hpp (from r76030, /sandbox/closure/boost/closure/aux_/macro/code_/deduce_result_type.hpp)
==============================================================================
--- /sandbox/closure/boost/closure/aux_/macro/code_/deduce_result_type.hpp (original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/result.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,47 +4,113 @@
 // 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_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE_HPP_
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE_HPP_
+#ifndef BOOST_CLOSURE_AUX_CODE_RESULT_HPP_
+#define BOOST_CLOSURE_AUX_CODE_RESULT_HPP_
 
-#include "../../symbol.hpp"
-#include "../../scope_exit/scope_exit.hpp" // Use this lib's ScopeExit impl.
+/** @todo uncomment these includes */
+#include <boost/closure/aux_/symbol.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_returns.hpp>
+//#include <boost/scope_exit.hpp>
+//#include <boost/typeof/typeof.hpp>
 #include <boost/type_traits/remove_pointer.hpp>
 #include <boost/type_traits/function_traits.hpp>
 #include <boost/preprocessor/control/iif.hpp>
-#include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/control/expr_iif.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/cat.hpp>
 
-// This must follow the result type.
-#define BOOST_LOCAL_AUX_FUNCTION_CODE_DEDUCE_RESULT_TYPE(id, is_template) \
- /* result type here */ (*BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id))(); \
- /* the many tagging, wrapping, etc that follow are taken from */ \
- /* Boost.ScopeExit type deduction mechanism and they are necessary */ \
- /* within template on GCC to work around a compiler internal error */ \
- typedef void (*BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_TAG(id))( \
- int BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id)); \
- typedef BOOST_PP_IIF(is_template, \
- BOOST_TYPEOF_TPL \
- , \
- BOOST_TYPEOF \
- )(boost::scope_exit::aux::wrap( \
- boost::scope_exit::aux::deref( \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id), \
- (BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_TAG(id))0))) \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_WRAP(id); \
- typedef BOOST_PP_EXPR_IIF(is_template, typename) \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_WRAP(id)::type \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_CAPTURE(id); \
- struct BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_PARAMS(id) { \
- typedef BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_CAPTURE(id) \
- function_ptr_type;\
+// PRIVATE //
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_TAG_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (deduce_result_tag)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_(id) \
+ /* symbol (not internal) also gives error if missing result type */ \
+ BOOST_PP_CAT( \
+ ERROR_missing_result_type_before_the_local_function_parameter_macro_id, \
+ id)
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_WRAP_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (deduce_result_wrap)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_CAPTURE_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (deduce_result_capture)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_PARAMS_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (deduce_result_params)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_TYPE_(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (deduce_result_function_type)(id) )
+
+// User did not explicitly specified result type, deduce it (using Typeof).
+#define BOOST_CLOSURE_AUX_CODE_RESULT_DEDUCE_(decl_traits, id, typename01) \
+ BOOST_CLOSURE_AUX_CODE_RESULT_DECL(decl_traits, id, \
+ typename01) \
+ /* the many tagging, wrapping, etc that follow are taken from ScopeExit */ \
+ /* type deduction mechanism and they are necessary within templates */ \
+ /* (at least on GCC) to work around an compiler internal error */ \
+ typedef \
+ void (*BOOST_CLOSURE_AUX_CODE_RESULT_TAG_(id))( \
+ int BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_(id) \
+ ) \
+ ; \
+ typedef \
+ BOOST_PP_IIF(typename01, BOOST_TYPEOF_TPL, BOOST_TYPEOF)( \
+ ::boost::scope_exit::aux::wrap( \
+ ::boost::scope_exit::aux::deref( \
+ BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_(id), \
+ (BOOST_CLOSURE_AUX_CODE_RESULT_TAG_(id))0 \
+ ) \
+ ) \
+ ) \
+ BOOST_CLOSURE_AUX_CODE_RESULT_WRAP_(id) \
+ ; \
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_CLOSURE_AUX_CODE_RESULT_WRAP_(id)::type \
+ BOOST_CLOSURE_AUX_CODE_RESULT_CAPTURE_(id) \
+ ; \
+ struct BOOST_CLOSURE_AUX_CODE_RESULT_PARAMS_(id) { \
+ /* this typedef is internal to struct so its name will not clash */ \
+ typedef BOOST_CLOSURE_AUX_CODE_RESULT_CAPTURE_(id) function_ptr; \
     }; \
- typedef BOOST_PP_EXPR_IIF(is_template, typename) boost::remove_pointer< \
- BOOST_PP_EXPR_IIF(is_template, typename) \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_PARAMS(id)::function_ptr_type \
- >::type BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC_TYPE(id); \
- typedef BOOST_PP_EXPR_IIF(is_template, typename) boost::function_traits< \
- BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC_TYPE(id)>::result_type \
- BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id);
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::remove_pointer< BOOST_PP_EXPR_IIF(typename01, typename) \
+ BOOST_CLOSURE_AUX_CODE_RESULT_PARAMS_(id)::function_ptr \
+ >::type \
+ BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_TYPE_(id) \
+ ; \
+ typedef BOOST_PP_EXPR_IIF(typename01, typename) \
+ ::boost::function_traits< \
+ BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_TYPE_(id) \
+ >::result_type \
+ BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) \
+ ;
+
+// Use result type as explicitly specified by user (no type deduction needed).
+#define BOOST_CLOSURE_AUX_CODE_RESULT_RETURN_( \
+ decl_traits, id, typename01) \
+ typedef \
+ BOOST_PP_LIST_FIRST(BOOST_CLOSURE_AUX_DECL_TRAITS_RETURNS( \
+ decl_traits)) \
+ BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) \
+ ;
+
+// PUBLIC //
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_TYPE(id) \
+ BOOST_CLOSURE_AUX_SYMBOL( (result_type)(id) )
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT_DECL( \
+ decl_traits, id, typename01) \
+ /* result type here */ (*BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_(id))();
+
+#define BOOST_CLOSURE_AUX_CODE_RESULT(decl_traits, id, typename01) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(BOOST_CLOSURE_AUX_DECL_TRAITS_RETURNS( \
+ decl_traits)), \
+ BOOST_CLOSURE_AUX_CODE_RESULT_RETURN_ \
+ , \
+ BOOST_CLOSURE_AUX_CODE_RESULT_DEDUCE_ \
+ )(decl_traits, id, typename01)
 
 #endif // #include guard
 

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/append.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/append.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/append.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -148,7 +148,7 @@
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
     , /* bind `this` types */ \
         BOOST_PP_LIST_APPEND( \
- BOOST_CLOUSRE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPE(decl_traits), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits), \
                 ( (this_type), BOOST_PP_NIL ) ) \
     , /* error message (if any) */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_params.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_params.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_params.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -8,30 +8,33 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_HPP_
 
 #include <boost/closure/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/closure/aux_/preprocessor/traits/param.hpp>
 #include <boost/closure/detail/preprocessor/keyword/default.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
 #include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/tuple/rem.hpp>
 #include <boost/preprocessor/arithmetic/inc.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/logical/compl.hpp>
 #include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/list/adt.hpp>
 #include <boost/preprocessor/list/fold_left.hpp>
 
 // PRIVATE //
 
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_COUNT_DEFAULTS_OP_(s, \
- default_count, param) \
- BOOST_PP_IIF(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAM_HAS_DEFAULT( \
- param), \
- BOOST_PP_INC \
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_OP_(s, \
+ default_count, param_traits) \
+ BOOST_PP_IIF(BOOST_PP_IS_EMPTY(BOOST_CLOSURE_AUX_PP_PARAM_TRAITS_DEFAULT( \
+ param_traits)), \
+ BOOST_PP_TUPLE_REM(1) \
     , \
- default_count BOOST_PP_TUPLE_EAT(1) \
+ BOOST_PP_INC \
     )(default_count)
 
-// Precondition: unbinds is a pp-list which is not nil.
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_COUNT_DEFAULTS_(params) \
+// Precondition: params is a pp-list which is not nil.
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT_(params) \
     BOOST_PP_LIST_FOLD_LEFT( \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAM_COUNT_DEFAULTS_OP_, \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_OP_, \
             0 /* start with defaults_count to 0 */, params)
 
 // PUBLIC //
@@ -42,9 +45,10 @@
             BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_PARAMS, decl_traits)
 
 // Expand: number of parameters with default values (0 if no default).
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_COUNT_DEFAULT_PARAMS(decl_traits) \
- BOOST_PP_IIF(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_PARAMS(decl_traits), \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_COUNT_DEFAULTS_ \
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT(decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits)), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT_ \
     , \
         0 BOOST_PP_TUPLE_EAT(1) \
     )(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits))

Modified: sandbox/closure/boost/closure/aux_/preprocessor/variadic/is.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/variadic/is.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/variadic/is.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -11,11 +11,12 @@
 
 #if !defined(BOOST_NO_VARIADIC_MACROS) // If no variadics then no macros.
 
-#include <boost/closure/aux_/preprocessor/size.hpp>
+#include <boost/closure/aux_/preprocessor/variadic/size.hpp>
 #include <boost/preprocessor/logical/compl.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/comparison/equal.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/eat.hpp> // For PP_EAT.
 // `IS_UNARY` not working on Borland and other pp which have no variadic anyway.
 #include <boost/preprocessor/detail/is_unary.hpp>
 
@@ -46,7 +47,7 @@
         BOOST_CLOSURE_AUX_PP_IS_VARIADIC_NOT_UNARY2_ \
     , /* size == 0 or size > 1 (it's variadic) */ \
         1 \
- BOOST_CLOSURE_AUX_PP_VARIADIC_EAT \
+ BOOST_PP_EAT \
     )(__VA_ARGS__)
 
 // PUBLIC //

Modified: sandbox/closure/boost/closure/aux_/symbol.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/symbol.hpp (original)
+++ sandbox/closure/boost/closure/aux_/symbol.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -4,96 +4,42 @@
 // 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_LOCAL_AUX_SYMBOL_HPP_
-#define BOOST_LOCAL_AUX_SYMBOL_HPP_
+#ifndef BOOST_CLOSURE_AUX_SYMBOL_HPP_
+#define BOOST_CLOSURE_AUX_SYMBOL_HPP_
 
-/** @todo Remove any macro define here that is not use anywhere. */
-
-#include "../config.hpp"
 #include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/seq/cat.hpp>
+#include <boost/preprocessor/seq/transform.hpp>
 
-// INFIX is used to separate symbols concatenamed together. Some of these
-// symbols are user defined so they can be anything. Because they can contain
-// underscore `_` and/or start with capital letters, it is NOT safe for the
-// INFIX to be the underscore `_` character as that could lead to library
-// defined symbols containing double underscores `__` which are reserved.
-// C++ standard: (1) "each name that contains a double underscore (_ _) or
-// begins with an underscore followed by an uppercase letter is reserved to
-// the implementation" and (2) "each name that begins with an underscore is
-// reserved to the implementation for use as a name in the global namespace".
-#define BOOST_LOCAL_AUX_SYMBOL_INFIX X // `X` used as separator.
-
-// Expand to `...aux...<name>` (internal).
-#define BOOST_LOCAL_AUX_INTERNAL_SYMBOL(name) \
- BOOST_PP_CAT(BOOST_PP_CAT(boost_local_aux, \
- BOOST_LOCAL_AUX_SYMBOL_INFIX), name)
-
-// Names (functions, variables, etc) //
-
-// Expand to `<name>...aux...` (internal).
-#define BOOST_LOCAL_AUX_SYMBOL_TYPEOF_TYPE(name) \
- BOOST_PP_CAT(BOOST_PP_CAT(name, BOOST_LOCAL_AUX_SYMBOL_INFIX), \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(typeof_type))
-
-#define BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC(id) \
- /* symbol (not internal) also gives error if missing result type */ \
- BOOST_PP_CAT(ERROR_missing_result_type_before_the_local_function_parameter_macro_id, id)
-
-#define BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_TAG(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(deduce_result_tag, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_WRAP(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(deduce_result_wrap, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_CAPTURE(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(deduce_result_capture, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_PARAMS(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(deduce_result_params, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_DEDUCE_RESULT_FUNC_TYPE(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(deduce_result_function_type, \
- id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_RESULT_TYPE(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(result_type, id))
+// PRIVATE //
 
-#define BOOST_LOCAL_AUX_SYMBOL_THIS_PARAM_NAME \
- BOOST_LOCAL_CONFIG_THIS_PARAM_NAME
-
-#define BOOST_LOCAL_AUX_SYMBOL_ARGS_VARIABLE_NAME \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(args)
-
-#define BOOST_LOCAL_AUX_SYMBOL_PARAMS_LOCAL_VARIABLE_NAME(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(params, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_CLASS_NAME(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(functor, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_OBJECT_NAME(local_function_name) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(BOOST_PP_CAT( \
- functor, BOOST_LOCAL_AUX_SYMBOL_INFIX), local_function_name))
-
-#define BOOST_LOCAL_AUX_SYMBOL_BINDS_VARIABLE_NAME \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(binds)
-
-#define BOOST_LOCAL_AUX_SYMBOL_FUNCTION_TYPE \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(function_type)
-
-#define BOOST_LOCAL_AUX_SYMBOL_FUNCTOR_TYPE \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(functor_type)
-
-#define BOOST_LOCAL_AUX_SYMBOL_BODY_FUNCTION_NAME \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(body)
-
-#define BOOST_LOCAL_AUX_SYMBOL_BLOCK_FUNCTION_NAME(id) \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(BOOST_PP_CAT(block_function, id))
-
-#define BOOST_LOCAL_AUX_SYMBOL_INIT_RECURSION_FUNCTION_NAME \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(init_recursion)
-
-#define BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME \
- BOOST_LOCAL_AUX_INTERNAL_SYMBOL(init_call)
+// NOTE: INFIX is used to separate symbols concatenated together. Some of these
+// symbols are user-defined so they can be anything. Because they can contain
+// underscore `_` and/or start with capital letters, it is NOT safe for the
+// INFIX to be the underscore `_` character because that could lead to library
+// defined symbols containing double underscores `__` or a leading underscore
+// (followed or not by a capital letter) in the global namespace. All these
+// symbols are reserved by the C++ standard: (1) "each name that contains a
+// double underscore (_ _) or begins with an underscore followed by an
+// uppercase letter is reserved to the implementation" and (2) "each name that
+// begins with an underscore is reserved to the implementation for use as a
+// name in the global namespace".
+#define BOOST_CLOSURE_AUX_SYMBOL_INFIX_ X // `X` used as separator.
+
+#define BOOST_CLOSURE_AUX_SYMBOL_POSTFIX_(s, unused, tokens) \
+ BOOST_PP_CAT(tokens, BOOST_CLOSURE_AUX_SYMBOL_INFIX_)
+
+// PUBLIC //
+
+// Prefixes this library reserved symbol.
+#define BOOST_CLOSURE_AUX_SYMBOL(seq) \
+ BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM(BOOST_CLOSURE_AUX_SYMBOL_POSTFIX_, \
+ ~, (boost_closure_aux) seq ))
+
+// Postfixes this library reserved symbol.
+#define BOOST_CLOSURE_AUX_SYMBOL_POSTFIX(seq) \
+ BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM(BOOST_CLOSURE_AUX_SYMBOL_POSTFIX_, \
+ ~, seq (boost_closure_aux) ))
 
 #endif // #include guard
 

Modified: sandbox/closure/boost/closure/detail/preprocessor/keyword/recursive.hpp
==============================================================================
--- sandbox/closure/boost/closure/detail/preprocessor/keyword/recursive.hpp (original)
+++ sandbox/closure/boost/closure/detail/preprocessor/keyword/recursive.hpp 2011-12-18 11:18:31 EST (Sun, 18 Dec 2011)
@@ -7,9 +7,9 @@
 #ifndef BOOST_CLOSURE_DETAIL_PP_KEYWORD_RECURSIVE_HPP_
 #define BOOST_CLOSURE_DETAIL_PP_KEYWORD_RECURSIVE_HPP_
 
-#include <boost/detail/preprocessor/keyword/facility/is.hpp>
-#include <boost/detail/preprocessor/keyword/facility/add.hpp>
-#include <boost/detail/preprocessor/keyword/facility/remove.hpp>
+#include <boost/closure/detail/preprocessor/keyword/facility/is.hpp>
+#include <boost/closure/detail/preprocessor/keyword/facility/add.hpp>
+#include <boost/closure/detail/preprocessor/keyword/facility/remove.hpp>
 
 // PRIVATE //
 


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