Boost logo

Boost :

From: Lois Goldthwaite (loisg_at_[hidden])
Date: 2000-07-16 16:04:49

Some of our tests in Hawaii showed that at least one compiler was able to use the
"throw()" specification to generate more optimized code, not less.

I thought we had a general principle to write "ideal" code and let the compilers
catch up. If our target compilers are capable of compiling code with exception
specifications, albeit with some loss of efficiency, I think this is a
documentation issue.

As I understand the purpose of throw specs, they should contribute to greater
robustness of code, and I believe there is some talk of strengthening the
language support for them next time around. Why pessimize the source code out of
fear the (currently inadequate) compiler will pessimize the output? (Unless, of
course, the output is so woefully inefficient that it becomes absolutely
necessary, but that should be a case-by-case decision, as Howard says.)


Howard Hinnant wrote:

> David Abrahams wrote on 7/16/2000 11:29 AM
> >From: "Beman Dawes" <beman_at_[hidden]>
> >
> >> Should boost programming guidelines ban exception-specifications?
> >
> >Yes, without specific compiler switches which turn them on when it's been
> >determined that it is an optimization.
> >But I am absolutely *certain* that we've discussed this on the list and that
> >there was (at least) a published web page which said they should be avoided.
> >I think it was the library guidelines. I am also pretty sure that the
> >discussion was specifically in reference to smart_ptr and that we had
> >decided to leave them off on purpose. So I'm surprised to hear that they
> >crept back in.
> No I don't think they should be banned. Though I will admit that I would
> vote against they're use in every project I'm currently familiar with.
> But I think they should be considered on a case by case basis, and not
> banned with a blanket statement. They provide a runtime behavior that
> could be desirable in some circumstances.
> -Howard
> ------------------------------------------------------------------------
> Wish you had something rad to add to your email?
> We do at
> ------------------------------------------------------------------------

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