|
Boost : |
From: Jeremy Day (jeremy.day_at_[hidden])
Date: 2006-06-29 14:48:52
On 6/29/06, Gennaro Prota <gennaro_prota_at_[hidden]> wrote:
>
> But Beman was specifically talking about throw() [read: no-throw], not
> exception specifications in general. Our docs say:
Right. I'm just suggesting that a programmer might do something
catastrophic, such as:
void foo() const throw()
{
throw std::bad_exception;
}
This obviously violates the no-throw specification but is, as near as I can
tell, entirely legal. A more likely case would be that foo calls some other
function, and that function throws an exception that isn't in foo's
exception specification (which, in this case, is a no-throw specification).
However, I could be wrong. I certainly have been before.
PS: out of curiosity, Jeremy, didn't you ask why the don't get removed
> from the standard then?
I did in fact ask that very question. He said that exception specifications
seemed like a good idea at the time, but have over time proved to be not
quite as good as expected. They cannot be removed now, because people do
use them, and you need to maintain backwards compatibility.
Jeremy
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk