Boost C++ Libraries: Ticket #10722: msm gives compilation errors when using state machine constructors with arguments https://svn.boost.org/trac10/ticket/10722 <p> This code compiles fine with boost 1.55.0 but fails on 1.56.0. Checked on MSVC2012 and gcc. </p> <pre class="wiki">#include &lt;boost/msm/back/state_machine.hpp&gt; // back-end #include &lt;boost/msm/back/tools.hpp&gt; #include &lt;boost/msm/front/state_machine_def.hpp&gt; // front-end #include &lt;boost/msm/front/functor_row.hpp&gt; #include &lt;boost/msm/front/euml/operator.hpp&gt; namespace msm = boost::msm; namespace mpl = boost::mpl; using namespace msm::front; struct Substate : public msm::front::state&lt;&gt; { }; struct State_ : public msm::front::state_machine_def&lt;State_&gt; { State_(int) {} State_() {} struct transition_table : mpl::vector&lt; // Start Event Next Action Guard // +------------+-------------+------------+-----------+------------+ Row &lt; Substate , none , none , none , none &gt; &gt; {}; typedef Substate initial_state; }; typedef msm::back::state_machine&lt;State_&gt; State; // machine itself struct TestFSM_ : public msm::front::state_machine_def&lt;TestFSM_&gt; { TestFSM_(int) {} TestFSM_() {} struct transition_table : mpl::vector&lt; // Start Event Next Action Guard // +------------+--------------+------------+-----------+-----------+ Row &lt; State , none , none , none , none &gt; &gt; {}; typedef State initial_state; }; typedef msm::back::state_machine&lt;TestFSM_&gt; TestFSM; void start() { TestFSM(msm::back::states_ &lt;&lt; State(10), 10); } </pre><p> Error output from MSVC2012 looks like this: </p> <pre class="wiki">1&gt; test.cpp 1&gt;c:\test\boost\boost\core\enable_if.hpp(36): error C2039: 'value' : is not a member of 'boost::is_convertible&lt;From,To&gt;' 1&gt; with 1&gt; [ 1&gt; From=boost::fusion::vector1&lt;boost::msm::back::state_machine&lt;State_&gt;&gt;, 1&gt; To=boost::msm::back::state_machine&lt;State_&gt; 1&gt; ] 1&gt; c:\test\boost\boost\type_traits\is_convertible.hpp(486) : see reference to class template instantiation 'boost::enable_if&lt;Cond,T&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Cond=boost::is_convertible&lt;boost::fusion::vector1&lt;boost::msm::back::state_machine&lt;State_&gt;&gt;,boost::msm::back::state_machine&lt;State_&gt;&gt;, 1&gt; T=void 1&gt; ] 1&gt; c:\test\boost\boost\core\enable_if.hpp(59) : see reference to class template instantiation 'boost::is_convertible&lt;From,To&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; From=boost::fusion::vector1&lt;boost::msm::back::state_machine&lt;State_&gt;&gt;, 1&gt; To=boost::msm::back::state_machine&lt;State_&gt; 1&gt; ] 1&gt; c:\test\boost\boost\fusion\container\vector\convert.hpp(46) : see reference to class template instantiation 'boost::disable_if&lt;Cond,T&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Cond=boost::is_convertible&lt;boost::fusion::vector1&lt;boost::msm::back::state_machine&lt;State_&gt;&gt;,boost::msm::back::state_machine&lt;State_&gt;&gt;, 1&gt; T=void 1&gt; ] 1&gt; c:\test\boost\boost\msm\back\state_machine.hpp(1564) : see reference to function template instantiation 'boost::fusion::vector1&lt;T0&gt; boost::fusion::as_vector&lt;boost::fusion::cons&lt;Car,Cdr&gt;&gt;(const Sequence &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; T0=boost::msm::back::state_machine&lt;State_&gt;, 1&gt; Car=boost::msm::back::state_machine&lt;State_&gt;, 1&gt; Cdr=boost::fusion::nil_, 1&gt; Sequence=boost::fusion::cons&lt;boost::msm::back::state_machine&lt;State_&gt;,boost::fusion::nil_&gt; 1&gt; ] 1&gt; c:\test\boost\boost\msm\back\state_machine.hpp(1655) : see reference to function template instantiation 'void boost::msm::back::state_machine&lt;A0&gt;::set_states&lt;Expr&gt;(const Expr &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; A0=TestFSM_, 1&gt; Expr=boost::msm::msm_terminal&lt;boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2&lt;const boost::msm::back::define_states_creation&lt;&gt; &amp;,boost::msm::msm_terminal&lt;boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term&lt;const boost::msm::back::state_machine&lt;State_&gt; &amp;&gt;,0&gt;&gt;&gt;,2&gt;&gt; 1&gt; ] 1&gt; c:\test\boost\boost\msm\back\state_machine.hpp(1655) : see reference to function template instantiation 'void boost::msm::back::state_machine&lt;A0&gt;::set_states&lt;Expr&gt;(const Expr &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; A0=TestFSM_, 1&gt; Expr=boost::msm::msm_terminal&lt;boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2&lt;const boost::msm::back::define_states_creation&lt;&gt; &amp;,boost::msm::msm_terminal&lt;boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term&lt;const boost::msm::back::state_machine&lt;State_&gt; &amp;&gt;,0&gt;&gt;&gt;,2&gt;&gt; 1&gt; ] 1&gt; c:\test\ffc\audioextractor\dataanalyzer\engines\test.cpp(47) : see reference to function template instantiation 'boost::msm::back::state_machine&lt;A0&gt;::state_machine&lt;boost::msm::msm_terminal&lt;Expr&gt;,int&gt;(const boost::msm::msm_terminal&lt;Expr&gt; &amp;,ARG0,void *)' being compiled 1&gt; with 1&gt; [ 1&gt; A0=TestFSM_, 1&gt; Expr=boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2&lt;const boost::msm::back::define_states_creation&lt;&gt; &amp;,boost::msm::msm_terminal&lt;boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term&lt;const boost::msm::back::state_machine&lt;State_&gt; &amp;&gt;,0&gt;&gt;&gt;,2&gt;, 1&gt; ARG0=int 1&gt; ] 1&gt; c:\test\ffc\audioextractor\dataanalyzer\engines\test.cpp(47) : see reference to function template instantiation 'boost::msm::back::state_machine&lt;A0&gt;::state_machine&lt;boost::msm::msm_terminal&lt;Expr&gt;,int&gt;(const boost::msm::msm_terminal&lt;Expr&gt; &amp;,ARG0,void *)' being compiled 1&gt; with 1&gt; [ 1&gt; A0=TestFSM_, 1&gt; Expr=boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2&lt;const boost::msm::back::define_states_creation&lt;&gt; &amp;,boost::msm::msm_terminal&lt;boost::proto::exprns_::basic_expr&lt;boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term&lt;const boost::msm::back::state_machine&lt;State_&gt; &amp;&gt;,0&gt;&gt;&gt;,2&gt;, 1&gt; ARG0=int 1&gt; ] 1&gt;c:\test\boost\boost\core\enable_if.hpp(36): error C2065: 'value' : undeclared identifier 1&gt;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&gt; c:\test\boost\boost\core\enable_if.hpp(27) : see declaration of 'B' </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10722 Trac 1.4.3 Christophe Henry Fri, 31 Oct 2014 14:49:02 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/10722#comment:1 https://svn.boost.org/trac10/ticket/10722#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> This works in develop (and therefore 1.57). Can you confirm? </p> Ticket Marek Glos <marekglos@…> Tue, 04 Nov 2014 08:49:03 GMT <link>https://svn.boost.org/trac10/ticket/10722#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10722#comment:2</guid> <description> <p> I've tried with boost 1.57.0 b1 with MSVC2012 and problem still occures. Can you reopen this? </p> </description> <category>Ticket</category> </item> <item> <author>Marek Glos <marekglos@…></author> <pubDate>Wed, 05 Nov 2014 08:07:20 GMT</pubDate> <title>status, version changed; resolution, milestone deleted https://svn.boost.org/trac10/ticket/10722#comment:3 https://svn.boost.org/trac10/ticket/10722#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.56.0</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.57.0</span> </li> </ul> Ticket