|
Boost : |
From: Thomas Witt (witt_at_[hidden])
Date: 2002-08-02 09:54:23
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 02 August 2002 16:01, David Abrahams wrote:
> From: "Thomas Witt" <witt_at_[hidden]>
>
> Eating the exception is a viable approach on any of these platforms, and
> may be preferable to termination when uncaught_exception is unavailable.
This might created a false sense of safety. In order to have the same
behaviour as on platforms that have uncaught_exception(), you will need
something like the following to "restore" the exception.
pseudo-code untested.
void gunc(ostream& out)
{
// Make sure io_state_saver dtor is called before we
// try to restore io exceptions.
{
io_state_saver s(out);
// Do smth.
}
// trigger an exception if the state_saver ate it even if no
// stack unwinding ocurred.
out.clear(out.rdstate());
}
I think that this is clumsy enough to not use this approach for platforms
where uncaught_exception is available, but it is easily forgotton on those
platforms where uncaught_exception is not available.
> However, a library author must take
> responsibility for the consequences of his code. The hard work must be
> done.
Violent agreement.
- --Thomas
- --
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9Sp0i0ds/gS3XsBoRAtUaAJ9ANFhp8pLbSTwfGSgPi//AUJpM8wCfVwGu
kNCVhnpjiEQZeCXDxs3DW3E=
=xvyx
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk