Boost logo

Boost Users :

Subject: Re: [Boost-users] [statechart] template state derived from simple_state compile error
From: Igor R (boost.lists_at_[hidden])
Date: 2010-07-25 17:04:04

> I'm experiencing a compiling problem with boost.statechart.
> I created a template class called request<TCallBackType> derived from
> state_machine,
> and two template states called init<TCallBackType> and post<TCallBackType>,
> the idea
> is that request's initial states is init, and when recating to an event
> (initialize) it transits
> to post.
> The error i get is :
> sc_test.cpp: In member function ‘boost::statechart::result
> init<TCallBackType>::react(const initialize&)’:
> sc_test.cpp:38: error: expected primary-expression before ‘>’ token
> sc_test.cpp:38: error: expected primary-expression before ‘)’ token
> I'm pretty sure this has to be with the fact that the template method
> transit is here
> dependant of the template parameter, thus the compiler can't solve it, but I
> can't seem
> to figure it out. Tryed using typename but did not work.
> I'm using gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

FWIW, your code compiles well in MSVC10

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