Boost logo

Boost :

Subject: Re: [boost] [Thread] Win32 exception handling
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-11-26 10:49:51


----- Original Message -----
From: "Alexander Terekhov" <terekhov_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, November 26, 2008 2:32 PM
Subject: Re: [boost] [Thread] Win32 exception handling

>
>
> "vicente.botet" wrote:
> [...]
>> >> Why do you associate an exception to a broken program state?
>
> [... example ...]
>
>> Why the operation can throw std::bad_alloc?
>
> Due to broken program state.

OK, broken program state can result in an exception thrown, but the opossit is not true. The user is unable to make a difference when the exception has been thrown because a broken program state or because of the logic.

In addition, if the program is in a broken state, it is even more possible that the program crashes than it throw an exception.

My preceding question should be: Why do you associate a broken program state with an exception?

So if the user program can throw exceptions and most of them can, the user need to catch the exception in order to unwind the local variables.

Vicente


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