
Andrey Semashev wrote:
Although I was pointing out something different in my previous post, returning a state or a reference to it has one major drawback. What "on_process" should return if the next state depends on the event contents?
It would return variant<State1&, State2&, /* ... */ >. Visual representation of FSM would be fuzzy but it still better than no visual representation at all.
Besides, when returning a reference, where should the state object be stored? For example, in a state machine object.
It may not be the current state member since it is destroyed on state exit. So, once again, it may only be a member of some outer state. Not necessarily. It may be a member of a state machine.
-- Alexander Nasonov http://nasonov.blogspot.com Every generation laughs at the old fashions, but follows religiously the new. -- Henry Thoreau -- This quote is generated by: /usr/pkg/bin/curl -L http://tinyurl.com/veusy \ | sed -e 's/^document\.write(.//' -e 's/.);$/ --/' \ -e 's/<[^>]*>//g' -e 's/^More quotes from //' \ | fmt | tee ~/.signature-quote