$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r76352 - in sandbox/closure: . boost boost/closure boost/closure/aux_ boost/closure/aux_/macro/code_ boost/closure/aux_/preprocessor/traits/decl_sign_ libs/closure/example
From: lorcaminiti_at_[hidden]
Date: 2012-01-07 18:43:23
Author: lcaminiti
Date: 2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
New Revision: 76352
URL: http://svn.boost.org/trac/boost/changeset/76352
Log:
Compiled returning example.
Added:
   sandbox/closure/Jamroot.v2
      - copied, changed from r76071, /sandbox/closure/Jamroot.jam
Removed:
   sandbox/closure/Jamroot.jam
Text files modified: 
   sandbox/closure/Jamroot.v2                                                     |    28 -                                       
   sandbox/closure/boost/closure/aux_/function.hpp                                |   170 ++++++++++---                           
   sandbox/closure/boost/closure/aux_/macro/code_/end.hpp                         |     4                                         
   sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp                     |   505 +++++++++++++++++++++++++++++---------- 
   sandbox/closure/boost/closure/aux_/macro/code_/result.hpp                      |     6                                         
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/sign.hpp     |     6                                         
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate.hpp |    14 +                                       
   sandbox/closure/boost/closure/config.hpp                                       |    10                                         
   sandbox/closure/boost/config_ext.hpp                                           |    10                                         
   sandbox/closure/libs/closure/example/Jamfile.v2                                |     5                                         
   sandbox/closure/libs/closure/example/profile_boost_closure.cpp                 |     6                                         
   sandbox/closure/libs/closure/example/profile_boost_phoenix.cpp                 |     4                                         
   12 files changed, 538 insertions(+), 230 deletions(-)
Deleted: sandbox/closure/Jamroot.jam
==============================================================================
--- sandbox/closure/Jamroot.jam	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
+++ (empty file)
@@ -1,33 +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).
-
-import os ;
-local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
-
-project
-    : requirements
-        <include>"."            # For this library.
-        <include>$(BOOST_ROOT)  # For Boost libraries.
-    ;
-
-# Boost.Chrono (which needs Boost.System) for GCC (not part of official Boost
-# release yet so assumed it was pre-built separately).
-#lib libboost_chrono : 
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.so <target-os>linux ;
-#lib libboost_chrono : 
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.a <target-os>cygwin ;
-#lib libboost_chrono : 
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono-vc80-mt-gd-1_47.lib
-#      <target-os>windows ;
-# Boost.System as used to build Boost.Chrono.
-#lib libboost_system :
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_system.so <target-os>linux ;
-#lib libboost_system :
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_system.a <target-os>cygwin ;
-#lib libboost_system :
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_system-vc80-mt-gd-1_47.lib
-#      <target-os>windows ;
-
Copied: sandbox/closure/Jamroot.v2 (from r76071, /sandbox/closure/Jamroot.jam)
==============================================================================
--- /sandbox/closure/Jamroot.jam	(original)
+++ sandbox/closure/Jamroot.v2	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -7,27 +7,11 @@
 import os ;
 local BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
 
-project
-    : requirements
-        <include>"."            # For this library.
-        <include>$(BOOST_ROOT)  # For Boost libraries.
-    ;
+use-project boost : $(BOOST_ROOT) ;
 
-# Boost.Chrono (which needs Boost.System) for GCC (not part of official Boost
-# release yet so assumed it was pre-built separately).
-#lib libboost_chrono : 
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.so <target-os>linux ;
-#lib libboost_chrono : 
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.a <target-os>cygwin ;
-#lib libboost_chrono : 
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono-vc80-mt-gd-1_47.lib
-#      <target-os>windows ;
-# Boost.System as used to build Boost.Chrono.
-#lib libboost_system :
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_system.so <target-os>linux ;
-#lib libboost_system :
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_system.a <target-os>cygwin ;
-#lib libboost_system :
-#    : <file>$(BOOST_ROOT)/stage/lib/libboost_system-vc80-mt-gd-1_47.lib
-#      <target-os>windows ;
+project : requirements
+    <include>"."
+    <include>$(BOOST_ROOT)
+    <define>BOOST_PP_VARIADICS # @todo remove this...
+;
 
Modified: sandbox/closure/boost/closure/aux_/function.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/function.hpp	(original)
+++ sandbox/closure/boost/closure/aux_/function.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -8,7 +8,8 @@
 #   ifndef BOOST_CLOSURE_AUX_FUNCTION_HPP_
 #       define BOOST_CLOSURE_AUX_FUNCTION_HPP_
 
-#       include <boost/closure/config.hpp>
+#       include <boost/closure/aux_/config.hpp>
+#       include <boost/closure/aux_/member.hpp>
 #       include <boost/call_traits.hpp>
 #       include <boost/preprocessor/iteration/iterate.hpp>
 #       include <boost/preprocessor/repetition/repeat.hpp>
@@ -31,20 +32,59 @@
 #define BOOST_CLOSURE_AUX_arg_type(z, arg_n, unused) \
     BOOST_PP_CAT(A, arg_n)
 
-#define BOOST_CLOSURE_AUX_arg_param_type(z, arg_n, unused) \
+#define BOOST_CLOSURE_AUX_comma_arg_tparam(z, arg_n, unused) \
+    , typename BOOST_CLOSURE_AUX_arg_type(z, arg_n, ~)
+
+#define BOOST_CLOSURE_AUX_arg_param_type(z, arg_n, comma01) \
+    BOOST_PP_COMMA_IF(comma01) \
     typename ::boost::call_traits< \
-        BOOST_CLOSURE_AUX_arg_type(z, arg_n, unused) \
+        BOOST_CLOSURE_AUX_arg_type(z, arg_n, ~) \
     >::param_type
 
-#define BOOST_CLOSURE_AUX_arg_name(z, arg_n, unused) \
+#define BOOST_CLOSURE_AUX_arg_name(z, arg_n, comma01) \
+    BOOST_PP_COMMA_IF(comma01) \
     BOOST_PP_CAT(a, arg_n)
 
-#define BOOST_CLOSURE_AUX_arg(z, arg_n, unused) \
-    BOOST_CLOSURE_AUX_arg_param_type(z, arg_n, unused) \
-    BOOST_CLOSURE_AUX_arg_name(z, arg_n, unused)
+#define BOOST_CLOSURE_AUX_arg_param_decl(z, arg_n, unused) \
+    BOOST_CLOSURE_AUX_arg_param_type(z, arg_n, 0 /* no leading comma */) \
+    BOOST_CLOSURE_AUX_arg_name(z, arg_n, 0 /* no leading comma */)
+
+#define BOOST_CLOSURE_AUX_bind_type(z, bind_n, unused) \
+    BOOST_PP_CAT(B, bind_n)
+
+#define BOOST_CLOSURE_AUX_comma_bind_type(z, bind_n, unused) \
+    , BOOST_CLOSURE_AUX_bind_type(z, bind_n, ~)
+
+#define BOOST_CLOSURE_AUX_comma_bind_ref(z, bind_n, unused) \
+    , BOOST_CLOSURE_AUX_bind_type(z, bind_n, ~) &
+
+#define BOOST_CLOSURE_AUX_comma_bind_tparam(z, bind_n, unused) \
+    , typename BOOST_CLOSURE_AUX_bind_type(z, bind_n, ~)
+
+#define BOOST_CLOSURE_AUX_bind_name(z, bind_n, unused) \
+    BOOST_PP_CAT(b, bind_n)
 
-#define BOOST_CLOSURE_AUX_arg_tparam(z, arg_n, unused) \
-    typename BOOST_CLOSURE_AUX_arg_type(z, arg_n, unused)
+#define BOOST_CLOSURE_AUX_comma_bind_param_decl(z, bind_n, unused) \
+    , \
+    BOOST_CLOSURE_AUX_bind_type(z, bind_n, ~) & \
+    BOOST_CLOSURE_AUX_bind_name(z, bind_n, ~)
+    
+#define BOOST_CLOSURE_AUX_bind_member(z, bind_n, unsued) \
+    BOOST_PP_CAT(BOOST_CLOSURE_AUX_bind_name(z, bind_n, ~), _)
+
+#define BOOST_CLOSURE_AUX_comma_bind_member_deref(z, bind_n, unsued) \
+    , member_deref<BOOST_CLOSURE_AUX_bind_type(z, bind_n, ~)>( \
+            BOOST_CLOSURE_AUX_bind_member(z, bind_n, ~))
+
+#define BOOST_CLOSURE_AUX_bind_member_init(z, bind_n, unused) \
+    BOOST_CLOSURE_AUX_bind_member(z, bind_n, ~) = member_addr( \
+            BOOST_CLOSURE_AUX_bind_name(z, bind_n, ~));
+
+#define BOOST_CLOSURE_AUX_bind_member_decl(z, bind_n, unused) \
+    /* must be ptr (not ref) so can use default constr */ \
+    typename member_type< BOOST_CLOSURE_AUX_bind_type(z, bind_n, ~) >::pointer \
+    BOOST_CLOSURE_AUX_bind_member(z, bind_n, ~) \
+    ;
 
 #define BOOST_CLOSURE_AUX_call_ptr(z, n, unused) \
     BOOST_PP_CAT(call_ptr, n)
@@ -56,27 +96,37 @@
     BOOST_PP_CAT(BOOST_CLOSURE_AUX_call_name(z, n, unused), _)
 
 #define BOOST_CLOSURE_AUX_call_typedef(z, n, arity) \
-    typedef R (*BOOST_CLOSURE_AUX_call_ptr(z, n, ~))(object_ptr \
-            BOOST_PP_COMMA_IF(BOOST_PP_SUB(arity, n)) \
-            BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, n), \
-                    BOOST_CLOSURE_AUX_arg_param_type, ~));
-
-#define BOOST_CLOSURE_AUX_call_param(z, n, unused) \
-    BOOST_CLOSURE_AUX_call_ptr(z, n, unused) \
-    BOOST_CLOSURE_AUX_call_name(z, n, unused)
+    typedef R (*BOOST_CLOSURE_AUX_call_ptr(z, n, ~))( \
+        object_ptr \
+        BOOST_PP_IIF( \
+                BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
+            BOOST_PP_TUPLE_EAT(3) \
+        , \
+            BOOST_PP_REPEAT_ ## z \
+        )(BOOST_CLOSURE_CONFIG_BIND_MAX, BOOST_CLOSURE_AUX_comma_bind_ref, ~) \
+        BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, n), \
+                BOOST_CLOSURE_AUX_arg_param_type, 1 /* leading comma */) \
+    );
+
+#define BOOST_CLOSURE_AUX_comma_call_param_decl(z, n, unused) \
+    , \
+    BOOST_CLOSURE_AUX_call_ptr(z, n, ~) \
+    BOOST_CLOSURE_AUX_call_name(z, n, ~)
 
 #define BOOST_CLOSURE_AUX_call_decl(z, n, unused) \
-    BOOST_CLOSURE_AUX_call_ptr(z, n, unused) \
-    BOOST_CLOSURE_AUX_call_member(z, n, unused);
+    BOOST_CLOSURE_AUX_call_ptr(z, n, ~) \
+    BOOST_CLOSURE_AUX_call_member(z, n, ~);
 
 #define BOOST_CLOSURE_AUX_call_init(z, n, unused) \
-    BOOST_CLOSURE_AUX_call_member(z, n, unused) = \
-            BOOST_CLOSURE_AUX_call_name(z, n, unuzed);
+    BOOST_CLOSURE_AUX_call_member(z, n, ~) = \
+            BOOST_CLOSURE_AUX_call_name(z, n, ~);
                 
 #define BOOST_CLOSURE_AUX_operator_call(z, defaults_n, arity) \
     /* precondition: object_ && call_function_ */ \
-    inline R operator()(BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
-                BOOST_CLOSURE_AUX_arg, ~)) const { \
+    inline R operator()( \
+        BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
+                BOOST_CLOSURE_AUX_arg_param_decl, ~) \
+    ) /* cannot be const (because of binds) */ { \
         /* run-time: do not assert preconditions here for efficiency */ \
         /* run-time: this function call is done via a function pointer */ \
         /* so unfortunately does not allow for compiler inlining */ \
@@ -84,15 +134,30 @@
         /* investigated but also virtual functions cannot be optimized */ \
         /* plus they require virtual table lookups to the alternative */ \
         /* performed worst) */ \
-        return BOOST_CLOSURE_AUX_call_member(z, defaults_n, ~)(object_ \
-                BOOST_PP_COMMA_IF(BOOST_PP_SUB(arity, defaults_n)) \
-                BOOST_PP_ENUM_ ## z(BOOST_PP_SUB(arity, defaults_n), \
-                        BOOST_CLOSURE_AUX_arg_name, ~)); \
+        return BOOST_CLOSURE_AUX_call_member(z, defaults_n, ~)( \
+            object_ \
+            BOOST_PP_IIF( \
+                    BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01,\
+                BOOST_PP_TUPLE_EAT(3) \
+            , \
+                BOOST_PP_REPEAT_ ## z \
+            )(BOOST_CLOSURE_CONFIG_BIND_MAX, \
+                    BOOST_CLOSURE_AUX_comma_bind_member_deref, ~) \
+            BOOST_PP_REPEAT_ ## z(BOOST_PP_SUB(arity, defaults_n), \
+                    BOOST_CLOSURE_AUX_arg_name, 1 /* leading comma */) \
+        ); \
     }
 
-namespace boost { namespace local { namespace aux {
+namespace boost { namespace closure { namespace aux {
 
-template<typename F, size_t defaults = 0>
+template<
+      typename F
+    , size_t defaults
+#if !BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+    BOOST_PP_REPEAT(BOOST_CLOSURE_CONFIG_BIND_MAX,
+            BOOST_CLOSURE_AUX_comma_bind_tparam, ~)
+#endif
+>
 class function {
     // Empty template cannot be used directly (only via its specializations).
 };
@@ -105,11 +170,12 @@
 
 }}} // namespace boost::loca::aux
 
+/** @todo undef all local macros */
 #undef BOOST_CLOSURE_AUX_arg_type
 #undef BOOST_CLOSURE_AUX_arg_param_type
 #undef BOOST_CLOSURE_AUX_arg_name
-#undef BOOST_CLOSURE_AUX_arg
-#undef BOOST_CLOSURE_AUX_arg_tparam
+#undef BOOST_CLOSURE_AUX_arg_param_decl
+#undef BOOST_CLOSURE_AUX_comma_arg_tparam
 #undef BOOST_CLOSURE_AUX_call_ptr
 #undef BOOST_CLOSURE_AUX_call_name
 #undef BOOST_CLOSURE_AUX_call_member
@@ -132,15 +198,23 @@
 #elif BOOST_PP_ITERATION_DEPTH() == 2
 #   define BOOST_CLOSURE_AUX_defaults BOOST_PP_FRAME_ITERATION(2)
 
-// Iterating within namespce `boost::closure::aux`.
+// Iterating within namespace `boost::closure::aux`.
 template<
     typename R
-    BOOST_PP_COMMA_IF(BOOST_CLOSURE_AUX_arity)
-    BOOST_PP_ENUM(BOOST_CLOSURE_AUX_arity, BOOST_CLOSURE_AUX_arg_tparam, ~)
+    BOOST_PP_REPEAT(BOOST_CLOSURE_AUX_arity,
+            BOOST_CLOSURE_AUX_comma_arg_tparam, ~)
+#if !BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+    BOOST_PP_REPEAT(BOOST_CLOSURE_CONFIG_BIND_MAX,
+            BOOST_CLOSURE_AUX_comma_bind_tparam, ~)
+#endif
 >
 class function<
       R (BOOST_PP_ENUM(BOOST_CLOSURE_AUX_arity, BOOST_CLOSURE_AUX_arg_type, ~))
     , BOOST_CLOSURE_AUX_defaults
+#if !BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+    BOOST_PP_REPEAT(BOOST_CLOSURE_CONFIG_BIND_MAX,
+            BOOST_CLOSURE_AUX_comma_bind_type, ~)
+#endif
 > {
     // The object type will actually be a local class which cannot be passed as
     // a template parameter so a generic `void*` pointer is used to hold the
@@ -156,20 +230,27 @@
     typedef void* object_ptr;
     BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_CLOSURE_AUX_defaults), // INC so no dflt.
             BOOST_CLOSURE_AUX_call_typedef, BOOST_CLOSURE_AUX_arity)
+
 public:
-    // run-time: use compiler-generated default constructor, copy constructor,
-    // and copy operator (this class only has pointers as member variables and
-    // they only need to be copied shallowly so the compiler-generator
-    // operations work well) to allow for compiler optimization
+    // NOTE: Must have default constructor for init without function name in
+    // function macro expansion.
 
     // Cannot be private but it should never be used by programmers directly
     // so used internal symbol.
     inline void BOOST_CLOSURE_AUX_FUNCTION_INIT_CALL_FUNC(
-        object_ptr object,
-        BOOST_PP_ENUM(BOOST_PP_INC(BOOST_CLOSURE_AUX_defaults), // INC no dflt.
-                BOOST_CLOSURE_AUX_call_param, ~)
+        object_ptr object
+#if !BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+        BOOST_PP_REPEAT(BOOST_CLOSURE_CONFIG_BIND_MAX,
+                BOOST_CLOSURE_AUX_comma_bind_param_decl, ~)
+#endif
+        BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_CLOSURE_AUX_defaults),// INC no dflt.
+                BOOST_CLOSURE_AUX_comma_call_param_decl, ~)
     ) {
         object_ = object;
+#if !BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+        BOOST_PP_REPEAT(BOOST_CLOSURE_CONFIG_BIND_MAX,
+                BOOST_CLOSURE_AUX_bind_member_init, ~)
+#endif
         BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_CLOSURE_AUX_defaults),
                 BOOST_CLOSURE_AUX_call_init, ~)
         unused_ = 0; // To avoid a GCC uninitialized variable error.
@@ -183,12 +264,15 @@
 
 private:
     object_ptr object_;
+#if !BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+    BOOST_PP_REPEAT(BOOST_CLOSURE_CONFIG_BIND_MAX,
+            BOOST_CLOSURE_AUX_bind_member_decl, ~)
+#endif
     BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_CLOSURE_AUX_defaults), // INC no dflt.
             BOOST_CLOSURE_AUX_call_decl, ~)
-
     // run-time: this unused void* member variable allows for compiler
     // optimizations (at least on MSVC it reduces invocation time of about 50%)
-    void* unused_;
+    void* unused_; /** @todo do I really need this? */
 };
 
 #   undef BOOST_CLOSURE_AUX_defaults
Modified: sandbox/closure/boost/closure/aux_/macro/code_/end.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/end.hpp	(original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/end.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -7,8 +7,8 @@
 #ifndef BOOST_CLOSURE_AUX_CODE_END_HPP_
 #define BOOST_CLOSURE_AUX_CODE_END_HPP_
 
-#include <boost/closure/config.hpp>
 #include <boost/closure/aux_/symbol.hpp>
+#include <boost/closure/aux_/config.hpp>
 #include <boost/closure/aux_/function.hpp>
 #include <boost/closure/aux_/macro/closure.hpp>
 #include <boost/closure/aux_/macro/code_/functor.hpp>
@@ -137,7 +137,7 @@
 // local functions even if they are not explicitly specified inline.
 #define BOOST_CLOSURE_AUX_CODE_END_MAYBE_INLINE_(qualified_name) \
     BOOST_PP_IIF(BOOST_PP_BITOR( \
-            BOOST_CLOSURE_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
+            BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
             BOOST_CLOSURE_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 */ \
Modified: sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp	(original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/functor.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -8,8 +8,11 @@
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_HPP_
 
 #include <boost/closure/aux_/symbol.hpp>
+#include <boost/closure/aux_/config.hpp>
 #include <boost/closure/aux_/function.hpp>
 #include <boost/closure/aux_/add_pointed_const.hpp>
+#include <boost/closure/aux_/member.hpp>
+#include <boost/closure/aux_/nobind.hpp>
 #include <boost/closure/aux_/macro/closure.hpp>
 #include <boost/closure/aux_/macro/closure_typeof.hpp>
 #include <boost/closure/aux_/macro/code_/result.hpp>
@@ -19,7 +22,7 @@
 #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/closure/detail/preprocessor/keyword/thisunderscore.hpp>
 #include <boost/utility/identity.hpp>
 #include <boost/scope_exit.hpp>
 #include <boost/type_traits/add_const.hpp>
@@ -82,9 +85,8 @@
         BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_TYPE_ \
     >::BOOST_PP_CAT(BOOST_PP_CAT(arg, i), _type) \
 
-#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_( \
         r, typename01, i, param_traits) \
-    BOOST_PP_COMMA_IF(i) \
     BOOST_PP_EXPR_IIF(typename01, typename) \
     ::boost::call_traits< \
         BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, \
@@ -92,6 +94,17 @@
     >::param_type \
     BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
 
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_( \
+        r, typename01, i, param_traits) \
+    BOOST_PP_COMMA_IF(i) \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_(r, typename01, i, \
+            param_traits)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_PARAM_ARG_DECL_( \
+        r, typename01, i, param_traits) \
+    , BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_(r, typename01, i, \
+            param_traits)
+
 // Precondition: !EMPTY(DEFAULT(param_traits))
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_(param_traits) \
     = BOOST_CLOSURE_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT( \
@@ -125,47 +138,56 @@
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
     BOOST_CLOSURE_AUX_SYMBOL( (bind_this) )
 
-#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_TYPE_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_STATIC_BIND_MEMBER_THIS_(id) \
+    , static_cast< BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* >(object)-> \
+      BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_TYPE_( \
         id, typename01, offset, i, bind_var_without_type) \
     BOOST_PP_EXPR_IIF(typename01, typename) \
     BOOST_SCOPE_EXIT_AUX_PARAMS_T(id):: \
     BOOST_SCOPE_EXIT_AUX_PARAM_T(id, BOOST_PP_ADD(i, offset), \
             bind_var_without_type) \
 
-#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_( \
         r, offset, i, bind_traits) \
     BOOST_PP_COMMA_IF(i) \
     BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
             BOOST_PP_ADD(offset, i))
 
 // Adapted from `BOOST_SCOPE_EXIT_AUX_ARG_DECL()`.
-#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
         r, id_typename_offset_const, i, bind_var_without_type) \
-    /* IMPORTANT: here can't use `PP_KEYWORD_IS_THIS_FRONT()` because some */ \
-    /* `param_name` might start with non-alphanumeric symbol `&` (but that */ \
-    /* is never the case for `this`) */ \
+    /* IMPORTANT: here can't use `PP_KEYWORD_IS_THISUNDERSCORE_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(4, 1, id_typename_offset_const), \
         typename \
     ) \
     BOOST_PP_IIF(BOOST_PP_COMPL(BOOST_PP_TUPLE_ELEM(4, 3, \
             id_typename_offset_const)), \
         BOOST_PP_EMPTY \
-    , BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+    , BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
             bind_var_without_type), \
         /* pointed obj const */ \
-        BOOST_PP_IDENTITY( ::boost::local::aux::add_pointed_const< ) \
+        BOOST_PP_IDENTITY( ::boost::closure::aux::add_pointed_const< ) \
     , \
         BOOST_PP_IDENTITY( ::boost::add_const< ) /* outer type const */ \
     ))() \
-    BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_TYPE_( \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_TYPE_( \
             BOOST_PP_TUPLE_ELEM(4, 0, id_typename_offset_const), \
             BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
             BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), \
             i, bind_var_without_type) \
     BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 3, id_typename_offset_const), \
         >::type \
-    ) \
-    BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+    )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
+        r, id_typename_offset_const, i, bind_var_without_type) \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+            r, id_typename_offset_const, i, bind_var_without_type) \
+    BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
             BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
                     bind_var_without_type)), \
         this_ BOOST_PP_TUPLE_EAT(1) \
@@ -173,6 +195,48 @@
         BOOST_PP_TUPLE_REM(1) \
     )(bind_var_without_type)
 
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_( \
+        r, id_typename_offset_const, i, bind_traits) \
+    , BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+            r, id_typename_offset_const, i, \
+            BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits))
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_(offset, i) \
+    BOOST_PP_CAT(bind, BOOST_PP_ADD(offset, i))
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_( \
+        r, offset, i, bind_traits) \
+    BOOST_PP_COMMA_IF(i) \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_(offset, i)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_( \
+        r, id_typename_offset_const, i, bind_traits) \
+    , BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+            r, id_typename_offset_const, i, \
+            BOOST_CLOSURE_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE(bind_traits)) & \
+      BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_( \
+            BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), i)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_(id) \
+    , BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id)
+      
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_ \
+    bind_this
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_(id) \
+    , BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) & \
+      BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_NOBIND_(z, n, unused) \
+    , ::boost::closure::aux::nobind
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_NOBIND_TYPE_(z, n, unused) \
+    , ::boost::closure::aux::nobind_t
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_NOBIND_PARAM_DECL_(z, n, unused) \
+    , ::boost::closure::aux::nobind_t & \
+    /* param name not needed here because no bind param not used */
+
 // Adapted from `BOOST_SCOPE_EXIT_AUX_ARG_DECL()`.
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
         r, id_typename_offset_const, i, bind_traits) \
@@ -183,14 +247,26 @@
 
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
         r, id_typename_offset_const, i, bind_traits) \
-    BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
-            r, id_typename_offset_const, i, \
-            & /* all bind member vars are refs to ScopeExit struct members */ \
-            BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
-                    BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
-                            id_typename_offset_const)))) \
+    BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
+        typename \
+    ) \
+    ::boost::closure::aux::member_type< \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
+                r, id_typename_offset_const, i, bind_var_without_type) \
+    >::reference \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+            BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
+                    id_typename_offset_const))) \
     ; /* end member variable declaration */
 
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_( \
+        r, id_typename_offset_const, i, bind_traits) \
+    , static_cast< BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_( \
+            BOOST_PP_TUPLE_ELEM(4, 0, id_typename_offset_const))* >(object)-> \
+      BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
+            BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
+            id_typename_offset_const)))
+
 // Adapted from `BOOST_SCOPE_EXIT_AUX_ARG()`.
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_( \
         r, id_offset, i, bind_traits) \
@@ -236,70 +312,128 @@
 
 // Functor call operations.
 
-#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_(z, defaults_n, decl_traits, \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_BODY_( \
+        const_bind_macro, bind_macro, const_bind_this_macro, bind_this_macro, \
+        param_macro, \
         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_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
-                typename01, params) \
-    ) const { \
-        /* just forward call to member function with local func name */ \
-        return BOOST_CLOSURE_AUX_CODE_FUNCTOR_BODY_FUNC_( \
-            BOOST_PP_LIST_FOR_EACH_I( \
-                    BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_, \
-                    0 /* no offset */, const_binds) \
-            /* pass plain binds */ \
-            BOOST_PP_COMMA_IF( \
-                BOOST_PP_BITAND( \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_BODY_FUNC_( \
+        BOOST_PP_LIST_FOR_EACH_I(const_bind_macro, \
+                0 /* no offset */, const_binds) \
+        /* pass plain binds */ \
+        BOOST_PP_COMMA_IF( \
+            BOOST_PP_BITAND( \
+                  BOOST_PP_LIST_IS_CONS(const_binds) \
+                , BOOST_PP_LIST_IS_CONS(binds) \
+            ) \
+        ) \
+        BOOST_PP_LIST_FOR_EACH_I(bind_macro, \
+                /* offset index of # const-binds (could be 0) */ \
+                BOOST_PP_LIST_SIZE(const_binds), binds) \
+        /* pass bind `this` */ \
+        BOOST_PP_COMMA_IF( \
+            BOOST_PP_BITAND( \
+                  BOOST_PP_BITOR( \
                       BOOST_PP_LIST_IS_CONS(const_binds) \
                     , BOOST_PP_LIST_IS_CONS(binds) \
-                ) \
+                  ) \
+                , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
             ) \
-            BOOST_PP_LIST_FOR_EACH_I( \
-                    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( \
-                BOOST_PP_BITAND( \
+        ) \
+        BOOST_PP_EXPR_IIF(has_const_bind_this, const_bind_this_macro) \
+        BOOST_PP_EXPR_IIF(has_bind_this, bind_this_macro) \
+        /* pass params */ \
+        BOOST_PP_COMMA_IF( \
+            BOOST_PP_BITAND( \
+                  BOOST_PP_BITOR( \
                       BOOST_PP_BITOR( \
                           BOOST_PP_LIST_IS_CONS(const_binds) \
                         , BOOST_PP_LIST_IS_CONS(binds) \
                       ) \
                     , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
-                ) \
+                  ) \
+                , BOOST_PP_LIST_IS_CONS(params) \
             ) \
-            BOOST_PP_EXPR_IIF( \
-                    BOOST_PP_BITOR(has_const_bind_this, has_bind_this), \
-                BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
-            ) \
-            /* pass params */ \
-            BOOST_PP_COMMA_IF( \
-                BOOST_PP_BITAND( \
-                      BOOST_PP_BITOR( \
-                          BOOST_PP_BITOR( \
-                              BOOST_PP_LIST_IS_CONS(const_binds) \
-                            , BOOST_PP_LIST_IS_CONS(binds) \
-                          ) \
-                        , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
-                      ) \
-                    , BOOST_PP_LIST_IS_CONS(params) \
-                ) \
-            ) \
-            BOOST_PP_LIST_FOR_EACH_I( \
-                    BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
-                    params) \
-        ); \
+        ) \
+        BOOST_PP_LIST_FOR_EACH_I(param_macro, ~, params) \
+    )
+
+#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_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
+                typename01, params) \
+    ) const { \
+        /* just forward call to member function with local func name */ \
+        return BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_BODY_( \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_, \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_, \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_, \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_, \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, \
+                params, const_binds, has_const_bind_this, binds, \
+                has_bind_this, id, typename01); \
     }
 
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_( \
         z, defaults_n, unused) \
     BOOST_CLOSURE_AUX_SYMBOL( (call)(defaults_n) )
 
-#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_ADDR_( \
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_FUNC_ADDR_( \
         z, defaults_n, unused) \
-    &BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, unused)
+    , &BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, unused)
+
+// Precondition: !CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_( \
+        const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    BOOST_PP_LIST_FOR_EACH_I( \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_, \
+            ( id, typename01, 0 /* no offset */, 1 /* const */ ), const_binds) \
+    BOOST_PP_LIST_FOR_EACH_I( \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_, \
+            /* offset of # of const-binds */ \
+            ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 /* const */ ),\
+            binds) \
+    BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+            has_const_bind_this), \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_ \
+    , \
+        BOOST_PP_TUPLE_EAT(1) \
+    )(id) \
+    /* fill with nobind_t (if no local-types as tparams) */ \
+    BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_CLOSURE_CONFIG_BIND_MAX, \
+            BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+                    has_const_bind_this), \
+                BOOST_PP_INC \
+            , \
+                BOOST_PP_TUPLE_REM(1) \
+            )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, \
+                    binds)))), \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_NOBIND_PARAM_DECL_, ~)
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_( \
+        params, const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    operator()( \
+        BOOST_PP_LIST_FOR_EACH_I( \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
+                params) \
+    )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_( \
+        params, const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_BODY_( \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_, \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_, \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_, \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_, \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, \
+            params, const_binds, has_const_bind_this, binds, \
+            has_bind_this, id, typename01)
 
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_(z, defaults_n, \
         decl_traits, params, const_binds, has_const_bind_this, binds, \
@@ -307,9 +441,15 @@
     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(params)) \
+        BOOST_PP_IIF( \
+                BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
+            BOOST_PP_TUPLE_EAT(6) \
+        , \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_ \
+        )(const_binds, has_const_bind_this, binds, has_bind_this, id, \
+                typename01) \
         BOOST_PP_LIST_FOR_EACH_I( \
-                BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_PARAM_ARG_DECL_, \
                 typename01, params) \
     ) { \
         /* run-time: casting object to this class type and forward call to */ \
@@ -320,14 +460,19 @@
         /* 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_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* >( \
-                object)->operator()( \
-            BOOST_PP_LIST_FOR_EACH_I( \
-                    BOOST_CLOSURE_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
-                    params) \
-        ); \
+        return \
+            static_cast< BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* >( \
+                    object)-> \
+            BOOST_PP_IIF( \
+                    BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01,\
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_ \
+            , \
+                BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_ \
+            )(params, const_binds, has_const_bind_this, binds, has_bind_this, \
+                    id, typename01) \
+        ; \
     }
-
+        
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_(z, n, \
         op_decl_params_constbinds_hasconstthis_binds_hasthis_id_typename) \
     BOOST_PP_EXPAND( \
@@ -358,10 +503,129 @@
     ) /* end `op_macro(...)` */ \
     ) /* end expand */
 
+// Functor binds.
+            
+// Precondition: !CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS.
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_( \
+        const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    BOOST_PP_LIST_FOR_EACH_I( \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_, \
+            ( id, typename01, 0 /* no offset */, 1 /* const */ ), \
+            const_binds) \
+    BOOST_PP_LIST_FOR_EACH_I( \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_, \
+            /* offset of # of const-binds */ \
+            ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 /* const */ ),\
+            binds) \
+    BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+            has_const_bind_this), \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_ \
+    , \
+        BOOST_PP_TUPLE_EAT(1) \
+    )(id) \
+    /* fill with nobind_t (if no local-types as tparams) */ \
+    BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_CLOSURE_CONFIG_BIND_MAX, \
+            BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
+                BOOST_PP_INC \
+            , \
+                BOOST_PP_TUPLE_REM(1) \
+            )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, binds)))), \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_NOBIND_TYPE_, ~)
+        
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
+        const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    /* 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_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_,\
+            (id, typename01, 0 /* no offset */, 1 /* const-bind */ ), \
+            const_binds) \
+    /* bind typeof types */ \
+    BOOST_PP_LIST_FOR_EACH_I( \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_, \
+            /* offset index with # of preceding const-binds (if any) */ \
+            ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
+              0 /* not const-bind */ ), binds) \
+    /* const this... */ \
+    BOOST_PP_EXPR_IIF(has_const_bind_this, \
+        typedef BOOST_CLOSURE_AUX_CLOSURE_TYPEOF_TYPE( \
+            BOOST_PP_EXPR_IIF(typename01, typename) \
+            ::boost::closure::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_CLOSURE_AUX_CLOSURE_TYPEOF_TYPE( \
+            BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
+            this_ \
+        ) ; /* close typedef */ \
+    )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_DECLS_( \
+        const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    /* run-time: it is faster if call `operator()` just accesses member */ \
+    /* 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_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_, \
+            ( id, typename01, 0 /* no offset */, 1 /* const */ ), \
+            const_binds) \
+    BOOST_PP_LIST_FOR_EACH_I( /* bind member references */ \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_, \
+            /* offset index of # of const-binds (could be 0) */ \
+            ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
+              0 /* no const */ ), 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_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) /* this is ptr so no & */ \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
+        ; /* end member variable declaration */ \
+    )
+
+#define BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_( \
+        const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
+    BOOST_PP_LIST_FOR_EACH_I( \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_, \
+        ( id, typename01, 0 /* no offset */, 1 /* const */ ), const_binds) \
+    BOOST_PP_LIST_FOR_EACH_I( \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_, \
+        /* offset of # of const-binds */ \
+        ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 /* const */ ), \
+        binds) \
+    BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
+            has_const_bind_this), \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_STATIC_BIND_MEMBER_THIS_ \
+    , \
+        BOOST_PP_TUPLE_EAT(1) \
+    )(id) \
+    /* fill with nobind_t (if no local-types as tparams) */ \
+    BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_CLOSURE_CONFIG_BIND_MAX, \
+            BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
+                BOOST_PP_INC \
+            , \
+                BOOST_PP_TUPLE_REM(1) \
+            )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, binds)))), \
+            BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_NOBIND_, ~)
+
+// Functor inits.
+        
 #define BOOST_CLOSURE_AUX_CODE_FUNCTOR_MEMBER_INITS_( \
-        const_binds, has_const_bind_this, binds, has_bind_this, id) \
+        const_binds, has_const_bind_this, binds, has_bind_this, \
+        id, typename01) \
     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)), \
+            BOOST_PP_LIST_IS_CONS(const_binds), BOOST_PP_LIST_IS_CONS(binds)),\
             has_bind_this), has_const_bind_this), \
         : \
     ) \
@@ -415,46 +679,23 @@
         /* it does not have to have ID postfix) */ \
         typedef BOOST_PP_EXPR_IIF(typename01, typename) \
             BOOST_IDENTITY_TYPE(( /* IDENTITY for template param comma */ \
-                ::boost::local::aux::function< \
+                ::boost::closure::aux::function< \
                       BOOST_CLOSURE_AUX_CODE_FUNCTOR_F_TYPE_ \
                     , default_count \
+                    BOOST_PP_IIF( \
+  BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
+                        BOOST_PP_TUPLE_EAT(6) \
+                    , \
+                        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_ \
+                    )(const_binds, has_const_bind_this, binds, has_bind_this, \
+                            id, typename01) \
                 > \
             )) \
             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_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_,\
-                (id, typename01, 0 /* no offset */, 1 /* const-bind */ ), \
-                const_binds) \
-        /* bind typeof types */ \
-        BOOST_PP_LIST_FOR_EACH_I( \
-                BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_, \
-                /* offset index with # of preceding const-binds (if any) */ \
-                ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
-                  0 /* not const-bind */ ), binds) \
-        /* const this... */ \
-        BOOST_PP_EXPR_IIF(has_const_bind_this, \
-            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_CLOSURE_AUX_CLOSURE_TYPEOF_TYPE( \
-                BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
-                this_ \
-            ) ; /* close typedef */ \
-        ) \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
+                const_binds, has_const_bind_this, binds, has_bind_this, \
+                id, typename01) \
     public: \
         /* constructor */ \
         inline explicit BOOST_CLOSURE_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)( \
@@ -463,7 +704,7 @@
             /* within paren so you must handle these commas manually if */ \
             /* expanding this macro within another macro */ \
             BOOST_CLOSURE_AUX_CODE_FUNCTOR_MEMBER_INITS_(const_binds, \
-                    has_const_bind_this, binds, has_bind_this, id) \
+                    has_const_bind_this, binds, has_bind_this, id, typename01) \
         { /* do nothing */ } \
         /* run-time: implement `operator()` (and for all default params) so */ \
         /* this obj can be used directly as a functor for C++03 extensions */ \
@@ -495,35 +736,25 @@
         ) \
         inline static void BOOST_CLOSURE_AUX_FUNCTION_INIT_CALL_FUNC( \
                 void* object, BOOST_CLOSURE_AUX_CODE_FUNCTOR_TYPE& functor) { \
-            functor.BOOST_CLOSURE_AUX_FUNCTION_INIT_CALL_FUNC(object, \
-                BOOST_PP_ENUM( \
-                        /* PP_INC to handle no dflt (EXPAND for MVSC) */ \
+            functor.BOOST_CLOSURE_AUX_FUNCTION_INIT_CALL_FUNC( \
+                    object \
+                    BOOST_PP_IIF( \
+  BOOST_CLOSURE_AUX_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01, \
+                        BOOST_PP_TUPLE_EAT(6) \
+                    , \
+                        BOOST_CLOSURE_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_ \
+                    )(const_binds, has_const_bind_this, binds, has_bind_this, \
+                            id, typename01) \
+                BOOST_PP_REPEAT( /* INC to handle no dflt (EXPAND for MVSC) */ \
                         BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
-                        BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_ADDR_, \
+  BOOST_CLOSURE_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_FUNC_ADDR_, \
                         ~) \
             ); \
         } \
     private: \
-        /* run-time: it is faster if call `operator()` just accesses member */ \
-        /* 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_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_,\
-                ( id, typename01, 0 /* no offset */, 1 /* const */ ), \
-                const_binds) \
-        BOOST_PP_LIST_FOR_EACH_I( /* bind member references */ \
-                BOOST_CLOSURE_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_, \
-                /* offset index of # of const-binds (could be 0) */ \
-                ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
-                  0 /* no const */ ), 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_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
-            & /* all bind member vars are refs to ScopeExit struct members */ \
-            BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
-            ; /* end member variable declaration */ \
-        ) \
+        BOOST_CLOSURE_AUX_CODE_FUNCTOR_BIND_MEMBER_DECLS_( \
+                const_binds, has_const_bind_this, binds, has_bind_this, \
+                id, typename01) \
         /* 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 */ \
@@ -564,7 +795,7 @@
                 /* const pointer to const object */ \
                 BOOST_PP_EXPR_IIF(has_const_bind_this, \
                     BOOST_PP_EXPR_IIF(typename01, typename) \
-                    ::boost::local::aux::add_pointed_const< \
+                    ::boost::closure::aux::add_pointed_const< \
                         BOOST_CLOSURE_AUX_CODE_BIND_THIS_TYPE(id) \
                     >::type const \
                     this_ /* special name to access object this */ \
Modified: sandbox/closure/boost/closure/aux_/macro/code_/result.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/macro/code_/result.hpp	(original)
+++ sandbox/closure/boost/closure/aux_/macro/code_/result.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -43,8 +43,7 @@
 
 // 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) \
+    BOOST_CLOSURE_AUX_CODE_RESULT_DECL(id) \
     /* 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 */ \
@@ -99,8 +98,7 @@
 #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) \
+#define BOOST_CLOSURE_AUX_CODE_RESULT_DECL(id) \
     /* result type here */ (*BOOST_CLOSURE_AUX_CODE_RESULT_FUNC_(id))();
 
 #define BOOST_CLOSURE_AUX_CODE_RESULT(decl_traits, id, typename01) \
Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/sign.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/sign.hpp	(original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/sign.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -17,7 +17,7 @@
 #include <boost/closure/detail/preprocessor/keyword/bind.hpp>
 #include <boost/closure/detail/preprocessor/keyword/return.hpp>
 #include <boost/closure/detail/preprocessor/keyword/default.hpp>
-#include <boost/closure/detail/preprocessor/keyword/this.hpp>
+#include <boost/closure/detail/preprocessor/keyword/thisunderscore.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/facilities/is_empty.hpp>
 #include <boost/preprocessor/seq/fold_left.hpp>
@@ -40,7 +40,7 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_( \
         decl_traits, sign) \
     /* check from back because non `this` bounds might have `&` in front */ \
-    BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+    BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
             /* remove all leading symbols `[const] bind [(type)] ...` */ \
             BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE(sign)),\
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_THIS_ \
@@ -64,7 +64,7 @@
 
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_(decl_traits, sign) \
     /* check from back because non `this` bounds might have `&` in front */ \
-    BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THIS_BACK( \
+    BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
             /* remove all leading symbols `[const] bind [(type)] ...` */ \
             BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_WITHOUT_TYPE( \
                     sign)), \
Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate.hpp	(original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -8,12 +8,24 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_HPP_
 
 #include <boost/closure/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_sign_/validate_/this.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+// PRIVATE //
+
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_1_(sign, error) \
+    BOOST_PP_IIF(BOOST_PP_IS_EMPTY(error(/* expand empty */)), \
+        BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_THIS \
+    , \
+        error BOOST_PP_TUPLE_EAT(1) \
+    )(sign)
 
 // PUBLIC //
 
 // Validate params seq before starting to parse it.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE(sign) \
-    BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS(sign)
+    BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_1_(sign, \
+        BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_DEFAULTS(sign))
 
 #endif // #include guard
 
Modified: sandbox/closure/boost/closure/config.hpp
==============================================================================
--- sandbox/closure/boost/closure/config.hpp	(original)
+++ sandbox/closure/boost/closure/config.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -12,8 +12,6 @@
 #ifndef BOOST_CLOSURE_CONFIG_HPP_
 #define BOOST_CLOSURE_CONFIG_HPP_
 
-#include <boost/config_ext.hpp>
-
 // User defined.
 
 /**
@@ -37,12 +35,8 @@
 #   define BOOST_CLOSURE_CONFIG_FUNCTION_ARITY_MAX 5
 #endif
 
-// For internal library use.
-
-#if defined(BOOST_LOCAL_TYPES_AS_TEMPLATE_PARAMS)
-#   define BOOST_CLOSURE_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01 1
-#else
-#   define BOOST_CLOSURE_CONFIG_LOCAL_TYPES_AS_TEMPLATE_PARAMS_01 0
+#ifndef BOOST_CLOSURE_CONFIG_BIND_MAX
+#   define BOOST_CLOSURE_CONFIG_BIND_MAX 3 /** @todo increase this (to 10?) */
 #endif
 
 #endif // #include guard
Modified: sandbox/closure/boost/config_ext.hpp
==============================================================================
--- sandbox/closure/boost/config_ext.hpp	(original)
+++ sandbox/closure/boost/config_ext.hpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -9,16 +9,22 @@
 
 #include <boost/config.hpp>
 
+/** @todo change the structure of this code when moved into Boost.Config which is organized by compiler (and not by feature) */
+
 // 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
+#   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
+#   define BOOST_LOCAL_TYPES_AS_TEMPLATE_PARAMS_
+#endif
+
+#if !defined(BOOST_LOCAL_TYPES_AS_TEMPLATE_PARAMS_)
+#   define BOOST_NO_LOCAL_TYPES_AS_TEMPLATE_PARAMS
 #endif
 
 #endif // #include guard
Modified: sandbox/closure/libs/closure/example/Jamfile.v2
==============================================================================
--- sandbox/closure/libs/closure/example/Jamfile.v2	(original)
+++ sandbox/closure/libs/closure/example/Jamfile.v2	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -1,9 +1,4 @@
 
-# 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).
-
 exe profile_boost_closure : profile_boost_closure.cpp :
     <library>/boost/chrono//boost_chrono
     <library>/boost/system//boost_system
Modified: sandbox/closure/libs/closure/example/profile_boost_closure.cpp
==============================================================================
--- sandbox/closure/libs/closure/example/profile_boost_closure.cpp	(original)
+++ sandbox/closure/libs/closure/example/profile_boost_closure.cpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -4,6 +4,7 @@
 // License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
 // copy at http://www.boost.org/LICENSE_1_0.txt).
 
+//[example_profile_boost_closure_cpp
 #include <boost/closure.hpp>
 #include <boost/chrono.hpp>
 #include <vector>
@@ -20,7 +21,7 @@
 
     boost::chrono::system_clock::time_point start =
             boost::chrono::system_clock::now();
-    void BOOST_CLOSURE( (const double& num) (bind& sum) (const bind& factor) ) {
+    void BOOST_CLOSURE(const double& num, bind& sum, const bind& factor) {
         sum += factor * num;
     } BOOST_CLOSURE_END(add)
     boost::chrono::duration<double> decl_sec =
@@ -30,7 +31,7 @@
     std::fill(v.begin(), v.end(), 1.0);
 
     boost::chrono::duration<double> trials_sec;
-    for (unsigned long i = 0; i < trials; ++i) {
+    for(unsigned long i = 0; i < trials; ++i) {
         boost::chrono::system_clock::time_point start =
                 boost::chrono::system_clock::now();
         std::for_each(v.begin(), v.end(), add);
@@ -40,4 +41,5 @@
     profile::print(size, trials, sum, trials_sec.count(), decl_sec.count());
     return 0;
 }
+//]
 
Modified: sandbox/closure/libs/closure/example/profile_boost_phoenix.cpp
==============================================================================
--- sandbox/closure/libs/closure/example/profile_boost_phoenix.cpp	(original)
+++ sandbox/closure/libs/closure/example/profile_boost_phoenix.cpp	2012-01-07 18:43:20 EST (Sat, 07 Jan 2012)
@@ -4,6 +4,7 @@
 // License, Version 1.0 (see accompanying file LICENSE_1_0.txt or a
 // copy at http://www.boost.org/LICENSE_1_0.txt).
 
+//[example_profile_boost_phoenix_cpp
 #include <boost/chrono.hpp>
 #include <boost/spirit/home/phoenix/statement/sequence.hpp>
 #include <boost/spirit/home/phoenix/core/reference.hpp>
@@ -25,7 +26,7 @@
     std::fill(v.begin(), v.end(), 1.0);
 
     boost::chrono::duration<double> trials_sec;
-    for (unsigned long i = 0; i < trials; ++i) {
+    for(unsigned long i = 0; i < trials; ++i) {
         boost::chrono::system_clock::time_point start =
                 boost::chrono::system_clock::now();
 
@@ -41,4 +42,5 @@
     profile::print(size, trials, sum, trials_sec.count());
     return 0;
 }
+//]