Hi,
I had almost the same problem you have. I solved it in this way:
#include
#include
#include
#include
#include
namespace sc = boost::statechart;
namespace mpl = boost::mpl;
struct Event1 : sc::event<Event1>
{};
template
struct ActiveBase : sc::simple_state
{
typedef sc::simple_state base;
sc::result react(const Event1& event)
{
return discard_event();
}
using base::discard_event;
};
struct Active;
struct FSM : sc::state_machine
{
};
struct Active : ActiveBase
{
typedef sc::custom_reaction<Event1> reactions;
};
int main()
{
FSM fsm;
fsm.initiate();
}
notice the custom_reaction instead on in_state reaction.
If you see in the documentation the function to specify for
the in state reaction must be:
"...|| Either the state defining the in-state reaction itself or one of
it direct or indirect contexts..."
since the base state (ActiveBase) is not known to the library the library
is not able to use the function specified in the in_state_reaction template.
Indeed if you specify Active instead of BaseActive in the in_state_reaction
template (like in_state_reaction) things work
a bit better. However this failes to compile anyway because the third
parameters is seen to be of type "void (ActiveBase::*)(const Event1&)"
and this doesn't match the required type.
Anyway this is only an hypothesis I would wait for the author response
in order to have a correct response.
Hope this is helpful.
Bye,
Tarcisio.