Boost logo

Boost :

From: E. Gladyshev (eegg_at_[hidden])
Date: 2004-05-28 04:27:06


From: "Andreas Huber" <ah2003_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, May 27, 2004 9:51 AM
Subject: [boost] Re: [prereview request][fsm]

> E. Gladyshev <egladysh <at> yahoo.com> writes:
>
> > > boost::fsm does exactly this and in a generic fashion.
> >
> > Does it mean that the state machine framework allows
> > me to specify what event it will generate
> > for a particular exception type?
>
> Yes, you can do that if you want (it is a per state machine policy). The
> default is to always dispatch an exception_thrown event.

After thinking about your solution a bit more,
I don't think that it is generic enough.

Your solution

try{...}
catch(...)
{
try { throw; }
catch( type1 ) { ... }
}

is very different from

try{...}
catch( type1 ) {...}

One of the differences is that in the first case, the stack unwinding will
be
triggered for any exception. In the second case, it is not necessarily the
case.

IMO, a truly generic solution should work like the second case.
So I seem to be back to my previous conclusion:
there is no way to properly discriminate exception types in boost::fsm.

Eugene


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk