Skip to content
Back to formatted view

Raw Message

Message-ID: <4E49E1FB.3090205@dcook.org>
Date: 2011-08-16T03:20:27Z
From: Darren Cook
Subject: [Rcpp-devel] Code Refactor Proposal: exception specifiers
In-Reply-To: <20041.56737.731427.995138@max.nulle.part>

> |  * Item 14 in Meyer's More Effective C++
> |   (the Session destructor example was enough to convince me.)
> 
> Hm, I don't have a copy handy right now, only his first and the STL one.

The whole Exceptions section (units 9 to 15) is worth a read.

> |  * C++0x has deprecated them.
> |   (it introduces "noexcept" as a better throw(), but not available until
> | g++ 4.6)
> 
> Right now I feel like 'wait and see'. We are pretty strict about suppressing
> g++ warnings and errors but this may not get addressed to g++ 4.7 or
> whichever warns about it.  All in all it seems more like a stylistical issue.

I wasn't proposing introducing noexcept at this stage; I was proposing
stripping out all the throw() specifications. They are very unlikely to
be of positive benefit, but can negatively affect performance.
(You would expect them to be a compile-time check, that has no effect on
run-time (*), but in reality they are the opposite: they are not used at
compile-time, but are used at run-time.)

Darren

*: Which I think is how they work in Java? (My java is getting rather
rusty.)

-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)