Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77793 - trunk/boost/msm/back
From: christophe.j.henry_at_[hidden]
Date: 2012-04-06 17:37:54


Author: chenry
Date: 2012-04-06 17:37:54 EDT (Fri, 06 Apr 2012)
New Revision: 77793
URL: http://svn.boost.org/trac/boost/changeset/77793

Log:
fix: visitor was passed by value to submachines
Text files modified:
   trunk/boost/msm/back/state_machine.hpp | 4 +++-
   1 files changed, 3 insertions(+), 1 deletions(-)

Modified: trunk/boost/msm/back/state_machine.hpp
==============================================================================
--- trunk/boost/msm/back/state_machine.hpp (original)
+++ trunk/boost/msm/back/state_machine.hpp 2012-04-06 17:37:54 EDT (Fri, 06 Apr 2012)
@@ -2021,16 +2021,18 @@
     }
 
 #define MSM_COMPOSITE_ACCEPT_SUB(z, n, unused) ARG ## n vis ## n
+#define MSM_COMPOSITE_ACCEPT_SUB2(z, n, unused) boost::ref( vis ## n )
 #define MSM_COMPOSITE_ACCEPT_EXECUTE(z, n, unused) \
         template <BOOST_PP_ENUM_PARAMS(n, class ARG)> \
         void composite_accept(BOOST_PP_ENUM(n, MSM_COMPOSITE_ACCEPT_SUB, ~ ) ) \
         { \
             this->accept(BOOST_PP_ENUM_PARAMS(n,vis)); \
- this->visit_current_states(BOOST_PP_ENUM_PARAMS(n,vis)); \
+ this->visit_current_states(BOOST_PP_ENUM(n,MSM_COMPOSITE_ACCEPT_SUB2, ~)); \
         }
         BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_COMPOSITE_ACCEPT_EXECUTE, ~)
 #undef MSM_COMPOSITE_ACCEPT_EXECUTE
 #undef MSM_COMPOSITE_ACCEPT_SUB
+#undef MSM_COMPOSITE_ACCEPT_SUB2
 
     // helper used to call the init states at the start of the state machine
     template <class Event>


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