#include #include #include namespace msm = boost::msm; namespace mpl = boost::mpl; using namespace msm::front; struct E {}; struct A : public state<> { bool started = false; template void on_entry(Event const&, Fsm& m) { m.process_event(E()); started = true; } }; struct check_started { template void operator()(Evt const&, Fsm&, SourceState& s, TargetState&) { assert(s.started); } }; struct Machine_ : public state_machine_def { struct transition_table : mpl::vector< // Start Event Target Action Guard // +--------+---------+--------+---------------------------+------+ Row< A , E , none , check_started , none > // +--------+---------+--------+---------------------------+------+ > {}; typedef A initial_state; }; typedef msm::back::state_machine Machine; int main() { Machine m; m.start(); return 0; }