Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-08-26 16:05:04


"Thorsten Ottosen" <nesotto_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> wrote in message news:u7jro6r4d.fsf_at_boost-consulting.com...
> | "Peter Dimov" <pdimov_at_[hidden]> writes:
> |
> | > Victor A. Wagner Jr. wrote:
> | >> OK, blunt point.
> | >> the standard is (insert favorite expletive or "in error") if it
> | >> allows use of std::runtime_error to terminate the program due to low
> | >> memory situations (run out of memory (due to copying) during stack
> | >> unwinding).
> | >
> | > It does not allow such a thing.
> |
> | No? It seemed to me that it does, for perversely low QOI
> | implementations.
>
> hm...funny. I talked with Matt Austern and Peter Becker about this in Sydney. They made me believe
> that if the copy-constrctor of a string throws in this line
>
> throw std::run_time_error( "foo" );
>
> then it wouldn't call terminate, but instead throw the wrong exception, namely (probably) a bad_alloc.
>
> Is that a misunderstanding?

No, that's correct.

In question was whether an exception can be thrown from within the
run_time_error's copy ctor during unwinding, and whether that would
cause termination. It's no longer clear to me that such an
implementation would be legal.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net