Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-08-04 06:21:07


Daryle,

On Sunday 04 August 2002 08:44, Daryle Walker wrote:
> on 8/2/02 3:14 PM, Thomas Witt at witt_at_[hidden] wrote:
>
> I adding a change to the docs explaining that both the failure-state and
> exception-state savers can throw on destruction (due to the way the
> accessors they use interact). I looked at the Standard, and I don't think
> passing "rdbuf" a NULL pointer doesn't cause a throw.

See 27.4.4.2-6 pg.615

Effect calls clear(). From my understanding this will throw due to badbit
being set if the exception mask allows for the specific exception.

> However, the
> failure-state method "clear" adds the "bad" state to whatever input state
> it gets if rdbuf is NULL. If you have a NULL rdbuf, then I think you
> didn't initialize your stream correctly, and I'm not taking responsibility
> for that bad (pardon the pun) behavior.

I don't by this argument, but it may be a viable strategy to simply eat the
exception in this case. The idea is that the user uses exceptions in order to
be informed about a change in the observable behavoiur of the stream. In this
case the observable state will not change.

--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

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