Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54559 - in trunk/boost: proto xpressive
From: eric_at_[hidden]
Date: 2009-07-01 03:21:56


Author: eric_niebler
Date: 2009-07-01 03:21:54 EDT (Wed, 01 Jul 2009)
New Revision: 54559
URL: http://svn.boost.org/trac/boost/changeset/54559

Log:
eliminate use of deprecated proto macros in proto's and xpressive's public interface
Text files modified:
   trunk/boost/proto/operators.hpp | 39 ++++++++---------
   trunk/boost/xpressive/regex_actions.hpp | 88 +++++++++++++++++++++------------------
   2 files changed, 66 insertions(+), 61 deletions(-)

Modified: trunk/boost/proto/operators.hpp
==============================================================================
--- trunk/boost/proto/operators.hpp (original)
+++ trunk/boost/proto/operators.hpp 2009-07-01 03:21:54 EDT (Wed, 01 Jul 2009)
@@ -319,13 +319,12 @@
 
     /// if_else
     ///
- BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(
- 3
- , if_else
- , deduce_domain
- , (tag::if_else_)
- , BOOST_PP_SEQ_NIL
- )
+ template<typename A0, typename A1, typename A2>
+ typename functional::make_expr<tag::if_else_>::impl<A0 const &, A1 const &, A2 const &>::result_type const
+ if_else(A0 const &a0, A1 const &a1, A2 const &a2)
+ {
+ return functional::make_expr<tag::if_else_>::impl<A0 const &, A1 const &, A2 const &>()(a0, a1, a2);
+ }
 
     BOOST_PROTO_END_ADL_NAMESPACE(exprns_)
 
@@ -337,59 +336,59 @@
 #define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \
     template<typename Arg> \
     typename boost::proto::detail::enable_unary<DOMAIN, TRAIT<Arg>, Arg \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Arg &>::type \
+ , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg &>::result_type \
>::type const \
     operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- return boost::proto::make_expr<TAG, DOMAIN>(boost::ref(arg)); \
+ return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg &>()(arg); \
     } \
     template<typename Arg> \
     typename boost::proto::detail::enable_unary<DOMAIN, TRAIT<Arg>, Arg \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Arg const &>::type \
+ , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg const &>::result_type \
>::type const \
     operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- return boost::proto::make_expr<TAG, DOMAIN>(boost::ref(arg)); \
+ return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg const &>()(arg); \
     } \
     /**/
 
 #define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Left &, Right &>::type \
+ , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right &>::result_type\
>::type const \
     operator OP(Left &left, Right &right) \
     { \
- return boost::proto::make_expr<TAG, DOMAIN>(boost::ref(left), boost::ref(right)); \
+ return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right &>()(left, right);\
     } \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Left &, Right const &>::type \
+ , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right const &>::result_type\
>::type const \
     operator OP(Left &left, Right const &right) \
     { \
- return boost::proto::make_expr<TAG, DOMAIN>(boost::ref(left), boost::ref(right)); \
+ return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right const &>()(left, right);\
     } \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Left const &, Right &>::type \
+ , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right &>::result_type\
>::type const \
     operator OP(Left const &left, Right &right) \
     { \
- return boost::proto::make_expr<TAG, DOMAIN>(boost::ref(left), boost::ref(right)); \
+ return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right &>()(left, right);\
     } \
     template<typename Left, typename Right> \
     typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::result_of::make_expr<TAG, DOMAIN, Left const &, Right const &>::type\
+ , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right const &>::result_type\
>::type const \
     operator OP(Left const &left, Right const &right) \
     { \
- return boost::proto::make_expr<TAG, DOMAIN>(boost::ref(left), boost::ref(right)); \
+ return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right const &>()(left, right);\
     } \
     /**/
 
 #define BOOST_PROTO_DEFINE_OPERATORS(TRAIT, DOMAIN) \
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(+, boost::proto::tag::unary_plus, TRAIT, DOMAIN, 0) \
+ BOOST_PROTO_DEFINE_UNARY_OPERATOR(+, boost::proto::tag::unary_plus, TRAIT, DOMAIN, 0) \
     BOOST_PROTO_DEFINE_UNARY_OPERATOR(-, boost::proto::tag::negate, TRAIT, DOMAIN, 0) \
     BOOST_PROTO_DEFINE_UNARY_OPERATOR(*, boost::proto::tag::dereference, TRAIT, DOMAIN, 0) \
     BOOST_PROTO_DEFINE_UNARY_OPERATOR(~, boost::proto::tag::complement, TRAIT, DOMAIN, 0) \

Modified: trunk/boost/xpressive/regex_actions.hpp
==============================================================================
--- trunk/boost/xpressive/regex_actions.hpp (original)
+++ trunk/boost/xpressive/regex_actions.hpp 2009-07-01 03:21:54 EDT (Wed, 01 Jul 2009)
@@ -15,6 +15,7 @@
 #endif
 
 #include <boost/config.hpp>
+#include <boost/preprocessor/punctuation/comma_if.hpp>
 #include <boost/ref.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/or.hpp>
@@ -191,6 +192,8 @@
         private:
             match_results<BidiIter> const &what_;
         };
+
+ typedef boost::proto::functional::make_expr<proto::tag::function, proto::default_domain> make_function;
     }
 
     namespace op
@@ -745,43 +748,39 @@
 
     /// as (a.k.a., lexical_cast)
     ///
- BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(
- 1
- , as
- , boost::proto::default_domain
- , (boost::proto::tag::function)
- , ((op::as)(typename))
- )
+ template<typename X2_0, typename A0>
+ typename detail::make_function::impl<op::as<X2_0> const, A0 const &>::result_type const
+ as(A0 const &a0)
+ {
+ return detail::make_function::impl<op::as<X2_0> const, A0 const &>()((op::as<X2_0>()), a0);
+ }
 
     /// static_cast_
     ///
- BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(
- 1
- , static_cast_
- , boost::proto::default_domain
- , (boost::proto::tag::function)
- , ((op::static_cast_)(typename))
- )
+ template<typename X2_0, typename A0>
+ typename detail::make_function::impl<op::static_cast_<X2_0> const, A0 const &>::result_type const
+ static_cast_(A0 const &a0)
+ {
+ return detail::make_function::impl<op::static_cast_<X2_0> const, A0 const &>()((op::static_cast_<X2_0>()), a0);
+ }
 
     /// dynamic_cast_
     ///
- BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(
- 1
- , dynamic_cast_
- , boost::proto::default_domain
- , (boost::proto::tag::function)
- , ((op::dynamic_cast_)(typename))
- )
+ template<typename X2_0, typename A0>
+ typename detail::make_function::impl<op::dynamic_cast_<X2_0> const, A0 const &>::result_type const
+ dynamic_cast_(A0 const &a0)
+ {
+ return detail::make_function::impl<op::dynamic_cast_<X2_0> const, A0 const &>()((op::dynamic_cast_<X2_0>()), a0);
+ }
 
     /// const_cast_
     ///
- BOOST_PROTO_DEFINE_FUNCTION_TEMPLATE(
- 1
- , const_cast_
- , boost::proto::default_domain
- , (boost::proto::tag::function)
- , ((op::const_cast_)(typename))
- )
+ template<typename X2_0, typename A0>
+ typename detail::make_function::impl<op::const_cast_<X2_0> const, A0 const &>::result_type const
+ const_cast_(A0 const &a0)
+ {
+ return detail::make_function::impl<op::const_cast_<X2_0> const, A0 const &>()((op::const_cast_<X2_0>()), a0);
+ }
 
     /// val()
     ///
@@ -829,21 +828,28 @@
 
     /// Usage: construct\<Type\>(arg1, arg2)
     ///
- BOOST_PROTO_DEFINE_VARARG_FUNCTION_TEMPLATE(
- construct
- , boost::proto::default_domain
- , (boost::proto::tag::function)
- , ((op::construct)(typename))
- )
-
     /// Usage: throw_\<Exception\>(arg1, arg2)
     ///
- BOOST_PROTO_DEFINE_VARARG_FUNCTION_TEMPLATE(
- throw_
- , boost::proto::default_domain
- , (boost::proto::tag::function)
- , ((op::throw_)(typename))
- )
+ #define BOOST_PROTO_LOCAL_MACRO(N, typename_A, A_const_ref, A_const_ref_a, a)\
+ \
+ template<typename X2_0 BOOST_PP_COMMA_IF(N) typename_A(N)>\
+ typename detail::make_function::impl<op::construct<X2_0> const BOOST_PP_COMMA_IF(N) A_const_ref(N)>::result_type const\
+ construct(A_const_ref_a(N))\
+ {\
+ return detail::make_function::impl<op::construct<X2_0> const BOOST_PP_COMMA_IF(N) A_const_ref(N)>()((op::construct<X2_0>()) BOOST_PP_COMMA_IF(N) a(N));\
+ }\
+ \
+ template<typename X2_0 BOOST_PP_COMMA_IF(N) typename_A(N)>\
+ typename detail::make_function::impl<op::throw_<X2_0> const BOOST_PP_COMMA_IF(N) A_const_ref(N)>::result_type const\
+ throw_(A_const_ref_a(N))\
+ {\
+ return detail::make_function::impl<op::throw_<X2_0> const BOOST_PP_COMMA_IF(N) A_const_ref(N)>()((op::throw_<X2_0>()) BOOST_PP_COMMA_IF(N) a(N));\
+ }\
+ /**/
+
+ #define BOOST_PROTO_LOCAL_a BOOST_PROTO_a
+ #define BOOST_PROTO_LOCAL_LIMITS (0, BOOST_PP_DEC(BOOST_PROTO_MAX_ARITY))
+ #include BOOST_PROTO_LOCAL_ITERATE()
 
     namespace detail
     {


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