Boost logo

Boost Users :

Subject: Re: [Boost-users] [MSM] problem compiling a functor-guard using a flaginside.
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2011-04-08 16:42:52

>while developing I want to use functors for a guard. The state machine compiles well until I added a
>function call to the FSM which has a template parameter. Then I always got the following error message
>while compiling it with gcc 4.4.1.

>SubtractionControllerNew.cpp: In member function ‘bool<unnamed>::player_::isCDLoaded::operator()(const EVT&, FSM&, SourceState&, TargetState&)’:
>SubtractionControllerNew.cpp:175: error: expected primary-expression before ‘>’ token
>SubtractionControllerNew.cpp:175: error: expected primary-expression before ‘)’ token
>Does anybody know why this happens and how to circumvent it?

I admit C++ is sometimes full of hard-to-get rules :(
Try adding a template keyword:

       struct isCDLoaded
            template <class EVT,class FSM,class SourceState,class TargetState>
            bool operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState& )
                   //return fsm.is_contained(); // this works well
                   return fsm.template is_flag_active<CDLoaded>(); // Line 175


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at