diff --git a/include/boost/msm/back/state_machine.hpp b/include/boost/msm/back/state_machine.hpp index 8bb84ab..7b84f9d 100644 --- a/include/boost/msm/back/state_machine.hpp +++ b/include/boost/msm/back/state_machine.hpp @@ -1634,6 +1634,9 @@ class state_machine : //public Derived fill_states(this); } // Construct with the default initial states and some default argument(s) +#if defined (BOOST_NO_CXX11_RVALUE_REFERENCES) \ + || defined (BOOST_NO_CXX11_VARIADIC_TEMPLATES) \ + || defined (BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) #define MSM_CONSTRUCTOR_HELPER_EXECUTE_SUB(z, n, unused) ARG ## n t ## n #define MSM_CONSTRUCTOR_HELPER_EXECUTE(z, n, unused) \ template \ @@ -1682,6 +1685,47 @@ class state_machine : //public Derived #undef MSM_CONSTRUCTOR_HELPER_EXECUTE #undef MSM_CONSTRUCTOR_HELPER_EXECUTE_SUB +#else + template ::type >::type> + state_machine(ARG0&& t0,ARG&&... t) + :Derived(std::forward(t0), std::forward(t)...) + ,m_events_queue() + ,m_deferred_events_queue() + ,m_history() + ,m_event_processing(false) + ,m_is_included(false) + ,m_visitors() + ,m_substate_list() + { + ::boost::mpl::for_each< seq_initial_states, ::boost::msm::wrap > + (init_states(m_states)); + m_history.set_initial_states(m_states); + fill_states(this); + } + template ::type >::type> + state_machine(Expr const& expr,ARG&&... t) + :Derived(std::forward(t)...) + ,m_events_queue() + ,m_deferred_events_queue() + ,m_history() + ,m_event_processing(false) + ,m_is_included(false) + ,m_visitors() + ,m_substate_list() + { + BOOST_MPL_ASSERT_MSG( + ( ::boost::proto::matches::value), + THE_STATES_EXPRESSION_PASSED_DOES_NOT_MATCH_GRAMMAR, + (FoldToList)); + ::boost::mpl::for_each< seq_initial_states, ::boost::msm::wrap > + (init_states(m_states)); + m_history.set_initial_states(m_states); + set_states(expr); + fill_states(this); + } +#endif // assignment operator using the copy policy to decide if non_copyable, shallow or deep copying is necessary @@ -2883,4 +2927,3 @@ BOOST_PP_REPEAT(BOOST_PP_ADD(BOOST_MSM_VISITOR_ARG_SIZE,1), MSM_VISITOR_ARGS_EXE } } }// boost::msm::back #endif //BOOST_MSM_BACK_STATEMACHINE_H -