Problem:
I believe there are a few problems with the current defer implementation.
According to this the defer queue should only be processed when a new state is entered.
Currently the defer queue is processed every time an event is handled.
This causes problems when the defer is combined with a guard or action.
Solution:
I attempted to check the defer queue only after a state change.
The check is only performed on the current state of the first region.
Therefore it is probably broken for state machines with orthogonal regions.
My solution also break the "defer_reaction" test.
If the test accurately describes how the sml::back::defer is supposed to work, then what is the difference with sml::back::process.
Problem: I believe there are a few problems with the current defer implementation. According to this the defer queue should only be processed when a new state is entered. Currently the defer queue is processed every time an event is handled. This causes problems when the defer is combined with a guard or action.
Solution: I attempted to check the defer queue only after a state change. The check is only performed on the current state of the first region. Therefore it is probably broken for state machines with orthogonal regions.
My solution also break the "defer_reaction" test. If the test accurately describes how the sml::back::defer is supposed to work, then what is the difference with sml::back::process.
Issue: #506 #586
Reviewers: @krzysztof-jusiak