Re: [Boost-users] [MSM] problem compiling a functor-guard using a flaginside.

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

Thanks, adding this template keyword as described works fine. Up to now, I have never seen this type of construct :) -----Ursprüngliche Nachricht----- Von: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] Im Auftrag von Christophe Henry Gesendet: Freitag, 8. April 2011 22:43 An: boost-users@lists.boost.org Betreff: Re: [Boost-users] [MSM] problem compiling a functor-guard using aflaginside.
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
participants (2)
-
Christophe Henry
-
Steckmann, Sven