Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-08-02 09:54:23

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.

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
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see


Boost list run by bdawes at, gregod at, cpdaniel at, john at