Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-07-12 22:22:48


Author: hkaiser
Date: 2008-07-12 22:22:47 EDT (Sat, 12 Jul 2008)
New Revision: 47372
URL: http://svn.boost.org/trac/boost/changeset/47372

Log:
Spirit: Fixed problem in action_dispatch
Text files modified:
   branches/release/boost/spirit/home/support/detail/action_dispatch.hpp | 31 +++++++++++--------------------
   1 files changed, 11 insertions(+), 20 deletions(-)

Modified: branches/release/boost/spirit/home/support/detail/action_dispatch.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/detail/action_dispatch.hpp (original)
+++ branches/release/boost/spirit/home/support/detail/action_dispatch.hpp 2008-07-12 22:22:47 EDT (Sat, 12 Jul 2008)
@@ -15,18 +15,9 @@
 namespace boost { namespace spirit { namespace detail
 {
     // general handler for everything not explicitly specialized below
- template <typename F, typename Attribute, typename Context>
+ template <typename F, typename Attribute, typename Context, bool IsSequence>
     bool action_dispatch(F const& f, Attribute& attr, Context& context
- , mpl::true_)
- {
- bool pass = true;
- f(attr, context, pass);
- return pass;
- }
-
- template <typename F, typename Attribute, typename Context>
- bool action_dispatch(F const& f, Attribute& attr, Context& context
- , mpl::false_)
+ , mpl::bool_<IsSequence>)
     {
         bool pass = true;
         f(attr, context, pass);
@@ -34,7 +25,7 @@
     }
 
     // handler for phoenix actors
-
+
     // If the component this action has to be invoked for is a sequence, we
     // wrap any non-fusion sequence into a fusion sequence (done by pass_value)
     // and pass through any fusion sequence.
@@ -63,9 +54,9 @@
     // specializations for plain function pointers taking a different number of
     // arguments
     template <typename RT, typename A0, typename A1, typename A2
- , typename Attribute, typename Context, typename IsSequence>
+ , typename Attribute, typename Context, bool IsSequence>
     bool action_dispatch(RT(*f)(A0, A1, A2)
- , Attribute& attr, Context& context, IsSequence)
+ , Attribute& attr, Context& context, mpl::bool_<IsSequence>)
     {
         bool pass = true;
         f(attr, context, pass);
@@ -73,27 +64,27 @@
     }
 
     template <typename RT, typename A0, typename A1
- , typename Attribute, typename Context, typename IsSequence>
+ , typename Attribute, typename Context, bool IsSequence>
     bool action_dispatch(RT(*f)(A0, A1)
- , Attribute& attr, Context& context, IsSequence)
+ , Attribute& attr, Context& context, mpl::bool_<IsSequence>)
     {
         f(attr, context);
         return true;
     }
 
     template <typename RT, typename A0
- , typename Attribute, typename Context, typename IsSequence>
+ , typename Attribute, typename Context, bool IsSequence>
     bool action_dispatch(RT(*f)(A0)
- , Attribute& attr, Context&, IsSequence)
+ , Attribute& attr, Context&, mpl::bool_<IsSequence>)
     {
         f(attr);
         return true;
     }
 
     template <typename RT
- , typename Attribute, typename Context, typename IsSequence>
+ , typename Attribute, typename Context, bool IsSequence>
     bool action_dispatch(RT(*f)()
- , Attribute&, Context&, IsSequence)
+ , Attribute&, Context&, mpl::bool_<IsSequence>)
     {
         f();
         return true;


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