|
Boost : |
From: Dave Abrahams (abrahams_at_[hidden])
Date: 1999-07-08 22:23:35
Email seemed somewhat boring, until Reid Sweatman wrote:
>
>> This is the rationale:
>> It is seldom that a compiler can make the above proof.
>> Very few compilers implement the aforementioned optimization.
>
>Okay, so it appears I did understand it correctly. So basically, you're
>making a trade-off of exception-safety for speed, right?
Absolutely not. In what sense is the program more exception-safe with the
exception-specification than without it?
You might convincingly argue that the program is more safe against
programmer mistakes (like violating a contract which says you're not allowed
to throw), but only if you consider termination to be an appropriate
response to such a mistake.
>And just out of
>curiosity, can you or anyone else supply a list (even partial would be
>useful) of compilers that either do or don't optimize as you mention?
I know the Sun compiler does it. I don't know of any others.
In particular, I know Metrowerks doesn't do it, though their EH
implementation is excellent in many respects.
>Thanks. Just for the record, I'm currently working with the last service
>release of both VC++ 5 and 6, but with a possibility of going to CodeWarrior
>for Windows sometime in the indeterminate future and for reasons no one's
>bothered to make clear <g>.
FWIW, VC++6 has a much less-efficient implementation of EH, contains serious
bugs that can result in double-destruction of thrown exceptions, and has
some bad interactions between catch(...) and post-mortem debugging.
Metrowerks suffers none of these problems.
-Dave
------------------------------------------------------------------------
eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk