|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71898 - in sandbox/local/boost/local/aux_/preprocessor/sign: . parse_params_
From: lorcaminiti_at_[hidden]
Date: 2011-05-12 11:58:48
Author: lcaminiti
Date: 2011-05-12 11:58:47 EDT (Thu, 12 May 2011)
New Revision: 71898
URL: http://svn.boost.org/trac/boost/changeset/71898
Log:
Added typed bind to src.
Added:
sandbox/local/boost/local/aux_/preprocessor/sign/param_any_bind.hpp (contents, props changed)
sandbox/local/boost/local/aux_/preprocessor/sign/parse_params_/any_bind_type.hpp (contents, props changed)
Added: sandbox/local/boost/local/aux_/preprocessor/sign/param_any_bind.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/boost/local/aux_/preprocessor/sign/param_any_bind.hpp 2011-05-12 11:58:47 EDT (Thu, 12 May 2011)
@@ -0,0 +1,46 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HPP_
+
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+#include <boost/preprocessor/facilities/is_empty.hpp>
+
+// PRIVATE //
+
+// Not-this bind is 2-tuple `(name_without_type, name_with_type)`.
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_WITHOUT_TYPE_ 0
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_WITH_TYPE_ 1
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_MAX_ 2
+
+// PUBLIC //
+
+// Bind not-this (const or not).
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITHOUT_TYPE(any_bind) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_MAX_, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_WITHOUT_TYPE_, \
+ any_bind)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITH_TYPE(any_bind) \
+ BOOST_PP_TUPLE_ELEM(BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_MAX_, \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_INDEX_WITH_TYPE_, \
+ any_bind)(/* expand empty */)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_HAS_TYPE(any_bind) \
+ BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_WITH_TYPE(any_bind)))
+
+// Bind this (const or not).
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_TYPE(any_bind_this_type) \
+ BOOST_PP_TUPLE_ELEM(1, 0, any_bind_this_type)(/* expand empty */)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_HAS_TYPE( \
+ any_bind_this_type) \
+ BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARAM_ANY_BIND_THIS_TYPE( \
+ any_bind_this_type)))
+
+#endif // #include guard
+
Added: sandbox/local/boost/local/aux_/preprocessor/sign/parse_params_/any_bind_type.hpp
==============================================================================
--- (empty file)
+++ sandbox/local/boost/local/aux_/preprocessor/sign/parse_params_/any_bind_type.hpp 2011-05-12 11:58:47 EDT (Thu, 12 May 2011)
@@ -0,0 +1,81 @@
+
+#ifndef BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_TYPE_HPP_
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_TYPE_HPP_
+
+#include "../../keyword/const_bind.hpp"
+#include <boost/detail/preprocessor/keyword/this.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/control/iif.hpp>
+#include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+// IS_UNARY is part of details because it does not work on BCC compiler.
+#include <boost/preprocessor/detail/is_unary.hpp>
+
+// PRIVATE //
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_TYPE_STRIP_PAREN_(\
+ type) type
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITH_TYPE_( \
+ tokens) \
+ BOOST_PP_EXPAND( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_TYPE_STRIP_PAREN_ \
+ BOOST_LOCAL_AUX_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(tokens)) \
+ BOOST_PP_EMPTY /* always trail EMPTY because bind type is optional */
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_TYPE_STRIP_( \
+ type) /* must expand to nothing */
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITHOUT_TYPE_( \
+ tokens) \
+ BOOST_PP_EXPAND( \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_TYPE_STRIP_ \
+ BOOST_LOCAL_AUX_PP_KEYWORD_CONST_BIND_REMOVE_FRONT(tokens))
+
+// PUBLIC //
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_HAS_TYPE(tokens) \
+ BOOST_PP_IS_UNARY(BOOST_LOCAL_AUX_PP_KEYWORD_CONST_BIND_REMOVE_FRONT( \
+ tokens))
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITH_TYPE(tokens) \
+ BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_HAS_TYPE( \
+ tokens), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITH_TYPE_ \
+ , \
+ BOOST_PP_EMPTY \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(tokens)
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITHOUT_TYPE( \
+ tokens) \
+ BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_HAS_TYPE( \
+ tokens), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITHOUT_TYPE_ \
+ , \
+ BOOST_LOCAL_AUX_PP_KEYWORD_CONST_BIND_REMOVE_FRONT \
+ )(tokens)
+
+// Private macro (but needs public macros above).
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_THIS_TYPE_( \
+ tokens) \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_WITH_TYPE( \
+ /* can't use `THIS_REMOVE_BACK` because `tokens` contains */ \
+ /* multiple tokens (and not just one token) so `IS_THIS_BACK` */ \
+ /* does not work -- but we know tokens ends with this if we */ \
+ /* here so we can manually force the removal using `CAT` */ \
+ BOOST_PP_CAT(tokens, _BOOST_DETAIL_PP_KEYWORD_THIS_REMOVE)) \
+ /* do not append PP_EMPTY because ANY_BIND_WITH_TYPE macro above */ \
+ /* already appends it */
+
+#define BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_THIS_TYPE(tokens) \
+ BOOST_PP_IIF(BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_HAS_TYPE(\
+ tokens), \
+ BOOST_LOCAL_AUX_PP_SIGN_PARSE_PARAMS_ANY_BIND_THIS_TYPE_ \
+ , \
+ BOOST_PP_EMPTY \
+ BOOST_PP_TUPLE_EAT(1) \
+ )(tokens)
+
+#endif // #include guard
+
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