|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-05-30 18:14:27
"Andreas Huber" <ah2003_at_[hidden]> writes:
>> If you remove A1, the "useful" behavior
>> is trivial to achieve without transforming the FSM, so it seems that a
>> design without A1 is both more flexible and more orthogonal.
>
> Removing A1 means complicating the interface (see my other post
> regarding exit()).
No it does not; see my other posts.
1. A1 has no *direct* bearing on whether you put your exit actions in
destructors or in exit(). You can pick any combination of A1,
!A1, exit actions, and destructors.
2. I'm fairly confident that you can allow exit() actions *and*
destructors to coexist without requiring every state to have
exit() actions and without loss of efficiency... but that's
really beside the point. I'm only interested in the question of
whether the state machine must enter its final state when
destroyed, here.
>>> BTW, as pointed out by someone else the user *does*
>>> have a choice. If she happens to have an exit action that she'd
>>> rather not have executed upon destruction then she can always
>>> transform the machine part in question such that her action is
>>> executed as part of a transition action instead (I would consider it
>>> a design error not to do so).
>>
>> Why?
Why?
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk