From c0e3b93b20919a3e5054d5da2811a747321c8d97 Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Fri, 9 Jul 2010 22:18:20 +0000 Subject: [PATCH] minor tweaks [SVN r63800] --- .../boost/phoenix/statement/detail/switch.hpp | 2 -- include/boost/phoenix/statement/switch.hpp | 33 ++++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/include/boost/phoenix/statement/detail/switch.hpp b/include/boost/phoenix/statement/detail/switch.hpp index 1ee4954..63cc25f 100644 --- a/include/boost/phoenix/statement/detail/switch.hpp +++ b/include/boost/phoenix/statement/detail/switch.hpp @@ -22,12 +22,10 @@ result_type operator()(Env& env, Cond const& cond, Case0 const& case0) const { - /* switch(eval(cond, env)) { case A0::value: eval(case0, env); break; } - */ } }; diff --git a/include/boost/phoenix/statement/switch.hpp b/include/boost/phoenix/statement/switch.hpp index 8221389..041782a 100644 --- a/include/boost/phoenix/statement/switch.hpp +++ b/include/boost/phoenix/statement/switch.hpp @@ -56,17 +56,27 @@ namespace boost { namespace phoenix struct result; template - struct result - : fusion::result_of::push_front::type const, Expr> + struct result + : fusion::result_of::push_front {}; + template + struct result + : fusion::result_of::push_front + {}; + + template + struct result + : fusion::result_of::push_front + {}; + + template - typename fusion::result_of::push_front::type - operator()(Expr const& expr, State const& state) + typename fusion::result_of::push_front::type + operator()(Expr const& expr, State& state) { return fusion::push_front(state, expr); } - }; template @@ -106,11 +116,18 @@ namespace boost { namespace phoenix > , proto::when< proto::binary_expr - , detail::push_front(switch_case(proto::_right), proto::_state) + , detail::push_front( + switch_case< + proto::_value(proto::_left) + , proto::_right + >(proto::_right) + , proto::_state) > , proto::when< proto::unary_expr - , detail::push_front(switch_default(proto::_child), proto::_state) + , detail::push_front( + switch_default(proto::_child) + , proto::_state) > > //> @@ -194,7 +211,7 @@ namespace boost { namespace phoenix typedef typename fusion::result_of::as_vector< typename boost::result_of< - switch_grammar(Cases const&, fusion::vector0<> const&) + switch_grammar(Cases const&, fusion::vector0<>&) >::type >::type cases_type;