Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-07-16 09:34:43


In another thread, Dave Abrahams wrote:

>Speaking of efficiency, you'd probably do well to leave off
>the exception-specifications. That will result in a pessimization
>on many compilers. Since the functions are inline, most compilers
>will be able to deduce that they can't throw anyway.

In reviewing the log file from the regression test, I noticed the following
from both Borland 5.4 and 5.5:

Warning W8026 c:/boost/site/libs/smart_ptr/smart_ptr_test.cpp 61: Functions
with exception specifications are not expanded inline in function main()

smart_ptr.hpp has throw specifiers on a number of time-critical inline
functions such as dereferencing:

   T& operator*() const throw() { return *ptr; }

It's a disaster if these aren't inlined.

Should boost programming guidelines ban exception-specifications?

--Beman


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