Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-07-21 16:53:30


----- Original Message -----
From: "Valentin Bonnard" <Bonnard.V_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, July 21, 2000 2:38 PM
Subject: Re: [boost] Exception specifications in smart_ptr.hpp

> Greg Colvin wrote:
>
> > For non-inline functions "throws nothing" specs may allow
> > optimizations that help more than their overhead hurts.
>
> In many compilers exceptions cost nothing in term of runtime.
> In some compilers exception specs cost a lot.
>
> I don't know of any compilers for which exceptions specs
> cost nothing but empty specs help in term of runtime. Could
> you name one ?

I think IBM's compiler has zero-time-overhead EH where empty exception specs
can help save space if used very carefully. Saving space can ultimately help
with runtime because of image size, swapping, etc... but I think it's a
marginal case if you're interested in speed. With a smart compiler, it's
executable image size which can be significantly reduced by using empty
exception specifications.

> I can't think of many real-world cases where non empty
> specs could help. For inline functions is doesn't help
> because the compiler would have as much info by performing
> inline substitution.

Agreed, 100%.

-Dave


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