Boost logo

Boost :

Subject: Re: [boost] [function] function wrapping with no exception safetyguarantee
From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2010-10-08 12:16:06


On Thu, Oct 7, 2010 at 10:44 PM, Bryce Lelbach
<admin_at_[hidden]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I think this is great, for selfish reasons. I'm currently working on a
> project that uses the clang and LLVM API. clang and LLVM coding
> conventions are to compile w/o exceptions and without RTTI. I'm able to
> compile the Boost that I use (Spirit/Proto/Fusion
> + deps mostly) without RTTI (after a minor fix to the provided Boost
> workaround), but getting jazz to compile without exceptions is a larger
> task. This would make it easier.
>
> clang and LLVM do not use exceptions and RTTI because they found that compiling without
> these two features decreases binary size and increased runtime speed. Given how popular
> clang and LLVM are, I think any changes that Boost can make to reduce RTTI/exception
> dependencies without decreasing the functionality or portability of Boost would be good
> for adoption.

I think the impact of exceptions on efficiency may vary from
application to application and certainly depends on the compiler's
optimization. (In optimized object code unsafe_function does not seem
to be significantly more efficient than boost::function.) But yes, if
your project finds it is best to work without RTTI then
boost::function's exception safety guarantee will get in the way, and
it would be nice to have a function wrapper with no exception safety
guarantee.

Daniel Walker


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