Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66643 - sandbox/SOC/2010/phoenix3/boost/phoenix/core
From: thom.heller_at_[hidden]
Date: 2010-11-19 07:16:52


Author: theller
Date: 2010-11-19 07:16:50 EST (Fri, 19 Nov 2010)
New Revision: 66643
URL: http://svn.boost.org/trac/boost/changeset/66643

Log:
fixed unpack for nullary expressions
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/unpack.hpp | 30 ++++++++++++++++++++++++++++++
   1 files changed, 30 insertions(+), 0 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/unpack.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/unpack.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/unpack.hpp 2010-11-19 07:16:50 EST (Fri, 19 Nov 2010)
@@ -79,6 +79,7 @@
>::value>
         struct unpack_impl;
         
+ /*
         template <typename Expr, typename State, typename Data, typename Seq, typename Fun, typename R>
         struct unpack_impl<Expr, State, Data, Seq, Fun, R(), 0>
             : proto::transform_impl<Expr, State, Data>
@@ -141,6 +142,7 @@
                 return typename which::template impl<Expr, State, Data>()(e, s, d);
             }
         };
+ */
 
 #define M5(_, N, __) fun_type(fusion_at_c< N >(Seq))
         
@@ -176,6 +178,34 @@
 
         #undef M1
 
+#define M1(Z, N, ARITY) \
+ template <typename Expr, typename State, typename Data, typename Seq, typename Fun, typename R BOOST_PP_ENUM_TRAILING_PARAMS(ARITY, typename A)> \
+ struct unpack_impl<Expr, State, Data, Seq, Fun, R(M2(unpack, N, ARITY)), 0> \
+ : proto::transform_impl<Expr, State, Data> \
+ { \
+ struct fun_type : proto::when<proto::_, Fun> {}; \
+ \
+ typedef proto::call<R(BOOST_PP_ENUM_PARAMS(ARITY, A))> \
+ which; \
+ \
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type; \
+ \
+ result_type \
+ operator()( \
+ typename unpack_impl::expr_param e \
+ , typename unpack_impl::state_param s \
+ , typename unpack_impl::data_param d \
+ ) const \
+ { \
+ return typename which::template impl<Expr, State, Data>()(e, s, d); \
+ } \
+ \
+ }; \
+ /**/
+
+ BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, M0, _)
+ #undef M1
+
         }
 }}
 


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