
Ilya Orlov
I missed your advice in previous message. I changed transition code to A1 state and it worked perfectly. But ideally, I'd like to transit from B not to A1 but to A state. How I can change this code to get it working with saving all history for A-substates?
I guess you are missing the fact that the template argument passed to deep_history is actually the *default* *state*. This is the state that is entered when no history has ever been saved. If history has been saved (as is the case in your example code) then transit< sc::deep_history < StateA1 > >() will transit to whatever inner state of A was active before A was exited. This is explained in more detail here: http://www.boost.org/doc/libs/1_52_0/libs/statechart/doc/tutorial.html#Histo... HTH, Andreas Huber P.S. In your example you're also specifying sc::deep_history< StateA1 > as InnerInitial of A. So you could even transit directly to A, as follows: return transit < StateA >(); and get exactly the same behavior as when you write: return transit< sc::deep_history < StateA1 > >();