-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
In the comment for transit function there is a note: do not send events in action_function definisions.
As I understand, that limitation is bacause of order of operations inside transit() functions:
current_state_ptr->exit();
action_function();
current_state_ptr = &_state_instance<S>::value;
current_state_ptr->entry();
Any state change caused by action_function() will be overriden by the next line.
What if we rearrange operations so that action is last:
current_state_ptr->exit();
current_state_ptr = &_state_instance<S>::value;
current_state_ptr->entry();
action_function();
Now we can call all API functions without limitation. Any state change caused by action_function() will count as any other.
What do you think?
Metadata
Metadata
Assignees
Labels
No labels