[Boost-bugs] [Boost C++ Libraries] #10722: msm gives compilation errors when using state machine constructors with arguments

Subject: [Boost-bugs] [Boost C++ Libraries] #10722: msm gives compilation errors when using state machine constructors with arguments
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-30 19:51:16


#10722: msm gives compilation errors when using state machine constructors with
arguments
--------------------------------------+---------------------
 Reporter: Marek Glos <marekglos@…> | Owner: chenry
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: msm
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: |
--------------------------------------+---------------------
 This code compiles fine with boost 1.55.0 but fails on 1.56.0.
 Checked on MSVC2012 and gcc.
 {{{
 #include <boost/msm/back/state_machine.hpp> // back-end
 #include <boost/msm/back/tools.hpp>
 #include <boost/msm/front/state_machine_def.hpp> // front-end
 #include <boost/msm/front/functor_row.hpp>
 #include <boost/msm/front/euml/operator.hpp>

 namespace msm = boost::msm;
 namespace mpl = boost::mpl;
 using namespace msm::front;

 struct Substate : public msm::front::state<> { };

 struct State_ : public msm::front::state_machine_def<State_>
 {
     State_(int) {}
     State_() {}

         struct transition_table : mpl::vector<
         // Start Event Next Action Guard
         //
 +------------+-------------+------------+-----------+------------+
         Row < Substate , none , none , none , none
>
> {};

     typedef Substate initial_state;
 };
 typedef msm::back::state_machine<State_> State;


 // machine itself
 struct TestFSM_ : public msm::front::state_machine_def<TestFSM_>
 {
     TestFSM_(int) {}
     TestFSM_() {}

     struct transition_table : mpl::vector<
         // Start Event Next Action Guard
         //
 +------------+--------------+------------+-----------+-----------+
         Row < State , none , none , none , none
>
> {};

     typedef State initial_state;
 };
 typedef msm::back::state_machine<TestFSM_> TestFSM;

 void start()
 {
     TestFSM(msm::back::states_ << State(10), 10);
 }
 }}}

 Error output from MSVC2012 looks like this:
 {{{
 1> test.cpp
 1>c:\test\boost\boost\core\enable_if.hpp(36): error C2039: 'value' : is
 not a member of 'boost::is_convertible<From,To>'
 1> with
 1> [
 1>
 From=boost::fusion::vector1<boost::msm::back::state_machine<State_>>,
 1> To=boost::msm::back::state_machine<State_>
 1> ]
 1> c:\test\boost\boost\type_traits\is_convertible.hpp(486) : see
 reference to class template instantiation 'boost::enable_if<Cond,T>' being
 compiled
 1> with
 1> [
 1>
 Cond=boost::is_convertible<boost::fusion::vector1<boost::msm::back::state_machine<State_>>,boost::msm::back::state_machine<State_>>,
 1> T=void
 1> ]
 1> c:\test\boost\boost\core\enable_if.hpp(59) : see reference to
 class template instantiation 'boost::is_convertible<From,To>' being
 compiled
 1> with
 1> [
 1>
 From=boost::fusion::vector1<boost::msm::back::state_machine<State_>>,
 1> To=boost::msm::back::state_machine<State_>
 1> ]
 1> c:\test\boost\boost\fusion\container\vector\convert.hpp(46) :
 see reference to class template instantiation 'boost::disable_if<Cond,T>'
 being compiled
 1> with
 1> [
 1>
 Cond=boost::is_convertible<boost::fusion::vector1<boost::msm::back::state_machine<State_>>,boost::msm::back::state_machine<State_>>,
 1> T=void
 1> ]
 1> c:\test\boost\boost\msm\back\state_machine.hpp(1564) : see
 reference to function template instantiation 'boost::fusion::vector1<T0>
 boost::fusion::as_vector<boost::fusion::cons<Car,Cdr>>(const Sequence &)'
 being compiled
 1> with
 1> [
 1> T0=boost::msm::back::state_machine<State_>,
 1> Car=boost::msm::back::state_machine<State_>,
 1> Cdr=boost::fusion::nil_,
 1>
 Sequence=boost::fusion::cons<boost::msm::back::state_machine<State_>,boost::fusion::nil_>
 1> ]
 1> c:\test\boost\boost\msm\back\state_machine.hpp(1655) : see
 reference to function template instantiation 'void
 boost::msm::back::state_machine<A0>::set_states<Expr>(const Expr &)' being
 compiled
 1> with
 1> [
 1> A0=TestFSM_,
 1>
 Expr=boost::msm::msm_terminal<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<const
 boost::msm::back::define_states_creation<>
 &,boost::msm::msm_terminal<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<const
 boost::msm::back::state_machine<State_> &>,0>>>,2>>
 1> ]
 1> c:\test\boost\boost\msm\back\state_machine.hpp(1655) : see
 reference to function template instantiation 'void
 boost::msm::back::state_machine<A0>::set_states<Expr>(const Expr &)' being
 compiled
 1> with
 1> [
 1> A0=TestFSM_,
 1>
 Expr=boost::msm::msm_terminal<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<const
 boost::msm::back::define_states_creation<>
 &,boost::msm::msm_terminal<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<const
 boost::msm::back::state_machine<State_> &>,0>>>,2>>
 1> ]
 1> c:\test\ffc\audioextractor\dataanalyzer\engines\test.cpp(47) :
 see reference to function template instantiation
 'boost::msm::back::state_machine<A0>::state_machine<boost::msm::msm_terminal<Expr>,int>(const
 boost::msm::msm_terminal<Expr> &,ARG0,void *)' being compiled
 1> with
 1> [
 1> A0=TestFSM_,
 1>
 Expr=boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<const
 boost::msm::back::define_states_creation<>
 &,boost::msm::msm_terminal<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<const
 boost::msm::back::state_machine<State_> &>,0>>>,2>,
 1> ARG0=int
 1> ]
 1> c:\test\ffc\audioextractor\dataanalyzer\engines\test.cpp(47) :
 see reference to function template instantiation
 'boost::msm::back::state_machine<A0>::state_machine<boost::msm::msm_terminal<Expr>,int>(const
 boost::msm::msm_terminal<Expr> &,ARG0,void *)' being compiled
 1> with
 1> [
 1> A0=TestFSM_,
 1>
 Expr=boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<const
 boost::msm::back::define_states_creation<>
 &,boost::msm::msm_terminal<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<const
 boost::msm::back::state_machine<State_> &>,0>>>,2>,
 1> ARG0=int
 1> ]
 1>c:\test\boost\boost\core\enable_if.hpp(36): error C2065: 'value' :
 undeclared identifier
 1>c:\test\boost\boost\core\enable_if.hpp(36): error C2975: 'B' : invalid
 template argument for 'boost::enable_if_c', expected compile-time constant
 expression
 1> c:\test\boost\boost\core\enable_if.hpp(27) : see declaration
 of 'B'
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10722>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC