Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70832 - trunk/boost/msm/back
From: christophe.j.henry_at_[hidden]
Date: 2011-04-01 16:07:32


Author: chenry
Date: 2011-04-01 16:07:31 EDT (Fri, 01 Apr 2011)
New Revision: 70832
URL: http://svn.boost.org/trac/boost/changeset/70832

Log:
- fixed trac 5253
- fixed warning unused variable
Text files modified:
   trunk/boost/msm/back/state_machine.hpp | 25 ++++++++++++++++++++++---
   1 files changed, 22 insertions(+), 3 deletions(-)

Modified: trunk/boost/msm/back/state_machine.hpp
==============================================================================
--- trunk/boost/msm/back/state_machine.hpp (original)
+++ trunk/boost/msm/back/state_machine.hpp 2011-04-01 16:07:31 EDT (Fri, 01 Apr 2011)
@@ -1254,7 +1254,27 @@
     {
         return m_history;
     }
- // get a state
+ // get a state (const version)
+ // as a pointer
+ template <class State>
+ typename ::boost::enable_if<typename ::boost::is_pointer<State>::type,State >::type
+ get_state(::boost::msm::back::dummy<0> = 0) const
+ {
+ return const_cast<State >
+ (&
+ (::boost::fusion::at_key<
+ typename ::boost::remove_const<typename ::boost::remove_pointer<State>::type>::type>(m_substate_list)));
+ }
+ // as a reference
+ template <class State>
+ typename ::boost::enable_if<typename ::boost::is_reference<State>::type,State >::type
+ get_state(::boost::msm::back::dummy<1> = 0) const
+ {
+ return const_cast<State >
+ ( ::boost::fusion::at_key<
+ typename ::boost::remove_const<typename ::boost::remove_reference<State>::type>::type>(m_substate_list) );
+ }
+ // get a state (non const version)
     // as a pointer
     template <class State>
     typename ::boost::enable_if<typename ::boost::is_pointer<State>::type,State >::type
@@ -1270,7 +1290,6 @@
     {
         return ::boost::fusion::at_key<typename ::boost::remove_reference<State>::type>(m_substate_list);
     }
-
     // checks if a flag is active using the BinaryOp as folding function
     template <class Flag,class BinaryOp>
     bool is_flag_active() const
@@ -1682,7 +1701,7 @@
         {
             // end of processing
             template<class Event>
- static void process(Event const& evt,library_sm*,HandledEnum&){}
+ static void process(Event const& ,library_sm*,HandledEnum&){}
         };
         public:
         region_processing_helper(library_sm* self_,HandledEnum& result_)


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