Boost logo

Boost Users :

Subject: Re: [Boost-users] [MSM] problem compiling a functor-guard using aflaginside.
From: Steckmann, Sven (sven.steckmann_at_[hidden])
Date: 2011-04-11 04:59:59


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_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] Im Auftrag von Christophe Henry
Gesendet: Freitag, 8. April 2011 22:43
An: boost-users_at_[hidden]
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 <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
            }
        };

HTH,
Christophe
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net