In Boost.Statechart, what's the difference between state and simple_state?

When implementing a state machine using Boost.Statechart, I ran into a problem related to trying to access the external context simple_statefrom my constructor. The comment in simple_state.hpptells me:

    // This assert fails when an attempt is made to access an outer 
    // context from a constructor of a state that is *not* a subtype of
    // state<>. To correct this, derive from state<> instead of
    // simple_state<>.

Besides being able to access the external context from my constructor, what differences or consequences exist when used state<>instead of simple_state<>as a base class for my states?

+1
source share
1 answer

, state < > , simple_state < > . . , < > .

, , , - , , , ( ), < > from simple_state < > .

+3

Source: https://habr.com/ru/post/1782113/


All Articles