[Rcpp-devel] Code Refactor Proposal: exception specifiers
Darren Cook
darren at dcook.org
Tue Aug 16 05:20:27 CEST 2011
> | * 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)
More information about the Rcpp-devel
mailing list