Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76025 - in sandbox/closure/boost/closure/aux_/preprocessor/traits: . decl_ decl_/validate_ decl_sign_ decl_sign_/validate_
From: lorcaminiti_at_[hidden]
Date: 2011-12-17 13:17:16


Author: lcaminiti
Date: 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
New Revision: 76025
URL: http://svn.boost.org/trac/boost/changeset/76025

Log:
Added return.
Added:
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate_/return_count.hpp (contents, props changed)
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_return.hpp (contents, props changed)
Text files modified:
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl.hpp | 6
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/append.hpp | 134 +++++++++++++++++++++++++--------------
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/index.hpp | 15 ++--
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/nil.hpp | 17 ++--
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/set_error.hpp | 5 +
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate.hpp | 6 +
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_bind.hpp | 12 +-
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_const_bind.hpp | 6
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp | 2
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp | 8 +
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/sign.hpp | 31 ++++-----
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate.hpp | 2
   sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp | 2
   13 files changed, 146 insertions(+), 100 deletions(-)

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -8,8 +8,8 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HPP_
 
 #include <boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_sign_/seq.hpp>
-#include <boost/closure/aux_/preprocessor/triats/decl_/nil.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_sign_/sign.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_/nil.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/tuple/eat.hpp>
 
@@ -25,7 +25,7 @@
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_NIL \
         BOOST_PP_TUPLE_EAT(1) \
     , \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_SEQ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN \
     )(declaration_seq)
 
 #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-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -7,9 +7,11 @@
 #ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_HPP_
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_HPP_
 
+#include <boost/closure/aux_/preprocessor/traits/decl_return.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_param.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_bind.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_const_bind.hpp>
+#include <boost/closure/detail/preprocessor/keyword/return.hpp>
 #include <boost/preprocessor/facilities/empty.hpp>
 #include <boost/preprocessor/list/append.hpp>
 #include <boost/preprocessor/list/size.hpp>
@@ -18,7 +20,7 @@
 
 // PRIVATE //
 
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_UNBIND_DEFAULT_( \
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT_( \
         params, default_value) \
     /* `DEC` ok because precondition that unbinds are not nil-list */ \
     BOOST_PP_LIST_APPEND( \
@@ -27,7 +29,7 @@
     , \
         ( /* list 2-tuple */ \
             ( /* (param_decl, default) 2-tuple */ \
- BOOST_LOCAL_AUX_PP_SIGN_PARAMS_UNBIND_PARAM_DECL( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAM_DECL( \
                         BOOST_PP_LIST_AT(params, BOOST_PP_DEC( \
                                 BOOST_PP_LIST_SIZE(params)))) \
             , \
@@ -40,11 +42,79 @@
 
 // PUBLIC //
 
+// return_type: `return result_type`.
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_RETURN( \
+ decl_traits, return_type) \
+ ( /* returns */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits), \
+ ( BOOST_CLOSURE_DETAIL_PP_KEYWORD_RETURN_REMOVE_FRONT( \
+ return_type), BOOST_PP_NIL ) ) \
+ , /* params and defaults */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ , /* const-bind vars */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
+ , /* bind vars */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+
+// param_decl: `[auto | register] type_ name_`.
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM(decl_traits, param_decl) \
+ ( /* returns */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_PP_LIST_APPEND( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
+ /* append param (with no default -- EMPTY) */ \
+ ( (param_decl, BOOST_PP_EMPTY), BOOST_PP_NIL ) ) \
+ , /* const-bind vars */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
+ , /* bind vars */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
+// default_value: a valid parameter default value (`-1`, etc).
+// Precondition: already added unbinds are not nil-list.
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT( \
+ decl_traits, default_value) \
+ ( /* returns */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* unbind params and defaults */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT_( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
+ default_value) /* append default to last added param */ \
+ , /* const-bind vars */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ , /* const-bind `this` types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
+ , /* bind vars */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
+ , /* bind `this` types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ , /* error message (if any) */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
+ )
+
 // var_without_type: `[&] var_` (var_ != this).
 // var_with_type: `PP_EMPTY | type [&] var_` (var_ != this).
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_BIND( \
         decl_traits, var_without_type, var_with_type) \
- ( /* params and defaults */ \
+ ( /* returns */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
     , /* const-bind vars */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
@@ -63,12 +133,14 @@
 // this_type: `PP_EMPTY | type`.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_BIND_THIS_TYPE( \
         decl_traits, this_type) \
- ( /* params and defaults */ \
+ ( /* returns */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
     , /* const-bind vars */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
     , /* const-bind `this` types */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
     , /* bind vars */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
     , /* bind `this` types */ \
@@ -83,8 +155,10 @@
 // var_with_type: `BOOST_PP_EMPTY | type_ [&] name_` (var_ != this).
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_CONST_BIND( \
         decl_traits, var_without_type, var_with_type) \
- ( /* params and defaults */ \
- BOOST_CLOURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
+ ( /* returns */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
     , /* const-bind vars */ \
         BOOST_PP_LIST_APPEND( \
                 BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits), \
@@ -102,10 +176,12 @@
 // this_type: `PP_EMPTY | type`.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_CONST_BIND_THIS_TYPE( \
         decl_traits, this_type) \
- ( /* params and defaults */ \
+ ( /* returns */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
     , /* const-bind vars */ \
- BOOST_CLOURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
     , /* const-bind `this` types */ \
         BOOST_PP_LIST_APPEND( \
                 BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
@@ -119,45 +195,5 @@
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
     )
 
-// param_decl: `[auto | register] type_ name_`.
-#define BOOST_CLOSURE_AUX_PP_SIGN_PARSED_PARAMS_APPEND_PARAM( \
- decl_traits, param_decl) \
- ( /* params and defaults */ \
- BOOST_PP_LIST_APPEND( \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
- /* append param (with no default -- EMPTY) */ \
- ( (param_decl, BOOST_PP_EMPTY), BOOST_PP_NIL ) ) \
- , /* const-bind vars */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
- , /* const-bind `this` types */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
- , /* bind vars */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
- , /* bind `this` types */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
- , /* error message (if any) */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
- )
-
-// default_value: a valid parameter default value (`-1`, etc).
-// Precondition: already added unbinds are not nil-list.
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT( \
- decl_traits, default_value) \
- ( /* unbind params and defaults */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_UNBIND_DEFAULT_( \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits), \
- default_value) /* append default to last added param */ \
- , /* const-bind vars */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
- , /* const-bind `this` types */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
- , /* bind vars */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
- , /* bind `this` types */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
- , /* error message (if any) */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_ERROR(decl_traits) \
- )
-
 #endif // #include guard
 

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/index.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/index.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/index.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -7,13 +7,14 @@
 #ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_HPP_
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_HPP_
 
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_PARAMS 0
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BINDS 1
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BIND_THIS_TYPES 2
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BINDS 3
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BIND_THIS_TYPES 4
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_ERROR 5
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX 6
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_RETURNS 0
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_PARAMS 1
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BINDS 2
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BIND_THIS_TYPES 3
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BINDS 4
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BIND_THIS_TYPES 5
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_ERROR 6
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX 7
 
 #endif // #include guard
 

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/nil.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/nil.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/nil.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -4,30 +4,33 @@
 // 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_PP_DECL_TRAITS_NIL_HPP_
-#define BOOST_LOCAL_AUX_PP_DECL_TRAITS_NIL_HPP_
+#ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_NIL_HPP_
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_NIL_HPP_
 
 #include <boost/preprocessor/facilities/empty.hpp>
 
-// See "index_.hpp".
-#define BOOST_LOCAL_AUX_PP_DECL_TRAITS_NIL \
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_NIL \
     ( \
- /* unbound params: list of 2-tuples (classified_name, default) */ \
+ /* returns: list of `return result_type` */ \
         BOOST_PP_NIL /* nil list */ \
     , \
- /* const-binds: list of 2-tuple `(name_untyped, name_typed)` */ \
+ /* params: list of 2-tuples (param_decl, param_default) */ \
+ BOOST_PP_NIL /* nil list */ \
+ , \
+ /* const-binds: list of 2-tuple `(var_untyped, var_typed)` */ \
         BOOST_PP_NIL /* nil list */ \
     , \
         /* const-bind this: list of 1-tuple `(type)` */ \
         BOOST_PP_NIL \
       /* number of const-bind `this` */ \
     , \
- /* binds: list of 2-tuple `(name_untyped, name_typed)` */ \
+ /* binds: list of 2-tuple `(var_untyped, var_typed)` */ \
         BOOST_PP_NIL /* nil list */ \
     , \
         /* bind this: list of 1-type `(type)` */ \
         BOOST_PP_NIL \
     , \
+ /* error: `[ERROR_message_text] EMPTY` */ \
         BOOST_PP_EMPTY /* no error */ \
     )
 

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/set_error.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/set_error.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/set_error.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -7,6 +7,7 @@
 #ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SET_ERROR_HPP_
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SET_ERROR_HPP_
 
+#include <boost/closure/aux_/preprocessor/traits/decl_return.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_param.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_bind.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_const_bind.hpp>
@@ -15,7 +16,9 @@
 
 // error: `[ERROR_message_text] EMPTY`, no ERROR_message_text if no error.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SET_ERROR(decl_traits, error) \
- ( /* unbind params and defaults */ \
+ ( /* return types */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ , /* params and defaults */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
     , /* const-bind names */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -8,12 +8,16 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_HPP_
 
 #include <boost/closure/aux_/preprocessor/traits/decl_/validate_/this_count.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_/validate_/return_count.hpp>
 
 // PUBLIC //
 
 // Validate params after they have been parsed.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE(decl_traits) \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT(decl_traits)
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_THIS_COUNT( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT( \
+ decl_traits \
+ ))
 
 #endif // #include guard
 

Added: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate_/return_count.hpp
==============================================================================
--- (empty file)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_/validate_/return_count.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -0,0 +1,40 @@
+
+// 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_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT_HPP_
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT_HPP_
+
+#include <boost/closure/aux_/preprocessor/traits/decl_/set_error.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_error.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_return.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/list/size.hpp>
+
+// PRIVATE //
+
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT_(decl_traits) \
+ BOOST_PP_IIF(BOOST_PP_GREATER(BOOST_PP_LIST_SIZE( \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits)), 1), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SET_ERROR \
+ , \
+ decl_traits BOOST_PP_TUPLE_EAT(2) \
+ )(decl_traits, /* trailing `EMPTY` because error might not be present */ \
+ ERROR_cannot_specify_more_than_one_return_type BOOST_PP_EMPTY)
+
+// PUBLIC //
+
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT(decl_traits) \
+ BOOST_PP_IIF(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_ERROR(decl_traits), \
+ decl_traits BOOST_PP_TUPLE_EAT(1) /* fwd existing error */ \
+ , \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_VALIDATE_RETURN_COUNT_ \
+ )(decl_traits)
+
+#endif // #include guard
+

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_bind.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_bind.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_bind.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -7,8 +7,8 @@
 #ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_HPP_
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_HPP_
 
-#include <boost/closure/aux_/preprocessor/traits/param_any_bind.hpp>
-#include <boost/closure/aux_/preprocessor/traits/params_/index.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_any_bind.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_/index.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
 #include <boost/preprocessor/list/adt.hpp> // For `IS_CONS`.
 #include <boost/preprocessor/list/transform.hpp>
@@ -23,7 +23,7 @@
 // Expand: pp-list of non-const binds.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
     BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX, \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BIND, decl_traits)
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BINDS, decl_traits)
 
 // Expand: 1 iff at least 1 non-const bind, 0 otherwise.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_BIND(decl_traits) \
@@ -33,7 +33,7 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS_WITHOUT_TYPE(decl_traits) \
     BOOST_PP_LIST_TRANSFORM(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_TYPED_, \
             BOOST_CLOSURE_AUX_PP_BIND_TRAITS_WITHOUT_TYPE, \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND(params))
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND(decl_traits))
 
 // Expand: pp-list of non-const binds with explicit types.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BINDS_WITH_TYPE(decl_traits) \
@@ -44,11 +44,11 @@
 // Expand: pp-list of types for bound this (size <= 1 only after validation).
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES(decl_traits) \
     BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX, \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BIND_THIS_TYPE, decl_traits)
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_BIND_THIS_TYPES, decl_traits)
 
 // Expand: 1 iff this was bound, 0 otherwise.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_BIND_THIS(decl_traits) \
- BOOST_PP_LIST_IS_CONS(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPE( \
+ BOOST_PP_LIST_IS_CONS(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
             decl_traits))
 
 #endif // #include guard

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_const_bind.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_const_bind.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_const_bind.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -23,7 +23,7 @@
 // Expand: pp-list of const-binds.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
     BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX, \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BIND, decl_traits)
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BINDS, decl_traits)
 
 // Expand: 1 iff at least 1 const-bind, 0 otherwise.
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_CONST_BIND(decl_traits) \
@@ -48,11 +48,11 @@
 // Expand: pp-list of type for const-bind of this (size <= 1 after validation).
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits) \
     BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX, \
- BOOST_CLOSURE_AUX_PP_DECL_TRIATS_INDEX_CONST_BIND_THIS_TYPE, \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_CONST_BIND_THIS_TYPES, \
             decl_traits)
 
 // Expand: 1 iff this is const-bind, 0 otherwise.
-#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_CONST_BIND_THIS(params) \
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_HAVE_CONST_BIND_THIS(decl_traits) \
     BOOST_PP_LIST_IS_CONS( \
             BOOST_CLOSURE_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES(decl_traits))
 

Added: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_return.hpp
==============================================================================
--- (empty file)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_return.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -0,0 +1,15 @@
+
+#ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURN_HPP_
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURN_HPP_
+
+#include <boost/closure/aux_/preprocessor/traits/decl_/index.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+// PUBLIC //
+
+#define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_RETURNS(decl_traits) \
+ BOOST_PP_TUPLE_ELEM(BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_MAX, \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_INDEX_RETURNS, decl_traits)
+
+#endif // #include guard
+

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -8,7 +8,7 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_ANY_BIND_TYPE_HPP_
 
 #include <boost/closure/detail/preprocessor/keyword/const_bind.hpp>
-#include <boost/detail/preprocessor/keyword/this.hpp>
+#include <boost/closure/detail/preprocessor/keyword/this.hpp>
 #include <boost/preprocessor/cat.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/facilities/empty.hpp>

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/is_void.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -8,7 +8,7 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_HPP_
 
 #include <boost/closure/config.hpp>
-#include <boost/detail/preprocessor/keyword/void.hpp>
+#include <boost/closure/detail/preprocessor/keyword/void.hpp>
 #include <boost/preprocessor/detail/is_unary.hpp>
 #include <boost/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/facilities/is_empty.hpp>
@@ -29,9 +29,11 @@
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_TOKEN_ALLOW_EMPTY_ \
         BOOST_PP_EMPTY \
     , \
- BOOST_DETAIL_PP_KEYWORD_IS_VOID_FRONT \
+ BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_VOID_FRONT \
     )(sign)
 
+/** @todo check that there's no BOOST_DETAIL_PP_KEYWORD anywhere */
+
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_SEQ_(sign) \
     BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_TOKEN_(BOOST_PP_SEQ_HEAD( \
             sign))
@@ -43,7 +45,7 @@
 // for C++ but similar to unparenthesized sign syntax for C99), or `(void)`
 // (parenthesized sign syntax for C++).
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID(sign) \
- BOOST_PP_IIF(BOOST_PP_IS_UNARY(parenthesized_params), \
+ BOOST_PP_IIF(BOOST_PP_IS_UNARY(sign), \
         /* it's a pp-seq */ \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_IS_VOID_SEQ_ \
     , /* else, it's a token */ \

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 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -8,23 +8,19 @@
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_HPP_
 
 #include <boost/closure/aux_/preprocessor/traits/decl_sign_/validate.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_sign_/valid.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_sign_/any_bind_type.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_/nil.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_/set_error.hpp>
 #include <boost/closure/aux_/preprocessor/traits/decl_/validate.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_/append_unbind.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_/append_unbind_default.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_/append_const_bind.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_/append_const_bind_this_type.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_/append_bind.hpp>
-#include <boost/closure/aux_/preprocessor/traits/decl_/append_bind_this_type.hpp>
-#include <boost/closure/detail/keyword/const_bind.hpp>
-#include <boost/closure/detail/keyword/bind.hpp>
-#include <boost/detail/preprocessor/keyword/default.hpp>
-#include <boost/detail/preprocessor/keyword/this.hpp>
+#include <boost/closure/aux_/preprocessor/traits/decl_/append.hpp>
+#include <boost/closure/detail/preprocessor/keyword/const_bind.hpp>
+#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/preprocessor/control/iif.hpp>
 #include <boost/preprocessor/facilities/is_empty.hpp>
+#include <boost/preprocessor/seq/fold_left.hpp>
 
 // PRIVATE //
 
@@ -80,20 +76,21 @@
 // Parse all elements.
 
 #define BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_(s, decl_traits, sign) \
- BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_BIND_FRONT(sign), \
+ BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_RETURN_FRONT(sign), \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_RETURN \
+ , BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_BIND_FRONT(sign), \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_BIND_ \
     , BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_CONST_BIND_FRONT(sign), \
         BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_CONST_BIND_ \
     , BOOST_PP_IIF(BOOST_CLOSURE_DETAIL_PP_KEYWORD_IS_DEFAULT_FRONT(sign), \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALID_UNBIND_DEFAULT_ \
         /* elem is `default ...` where leading default is kept because */ \
         /* default value might not be alphanumeric (so it fails later CAT */ \
         /* for checks), leading default will be removed later when getting */ \
         /* the default value */ \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_UNBIND_DEFAULT \
- , \
- BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_UNBIND \
- )))(decl_traits, sign)
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM_DEFAULT \
+ , /* else, it is a function parameter */ \
+ BOOST_CLOSURE_AUX_PP_DECL_TRAITS_APPEND_PARAM \
+ ))))(decl_traits, sign)
 
 // Parse param seq after following precondition has been validated by caller.
 // Precondition: If seq contains a default param value `... (default ...) ...`,

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 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -7,7 +7,7 @@
 #ifndef BOOST_CLOSURE_AUX_PP_DECL_TRAITS_SIGN_VALIDATE_HPP_
 #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_/defaults.hpp>
 
 // PUBLIC //
 

Modified: sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp
==============================================================================
--- sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp (original)
+++ sandbox/closure/boost/closure/aux_/preprocessor/traits/decl_sign_/validate_/defaults.hpp 2011-12-17 13:17:14 EST (Sat, 17 Dec 2011)
@@ -9,7 +9,7 @@
 
 #include <boost/closure/detail/preprocessor/keyword/const_bind.hpp>
 #include <boost/closure/detail/preprocessor/keyword/bind.hpp>
-#include <boost/detail/preprocessor/keyword/default.hpp>
+#include <boost/closure/detail/preprocessor/keyword/default.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
 #include <boost/preprocessor/control/while.hpp>
 #include <boost/preprocessor/control/iif.hpp>


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