Boost logo

Boost :

Subject: Re: [boost] [function] function wrapping with noexceptionsafetyguarantee
From: Domagoj Saric (dsaritz_at_[hidden])
Date: 2010-10-17 19:33:20


"Emil Dotchevski" <emil_at_[hidden]> wrote in message
news:AANLkTi=5z+8LYDTAPLSaivGRsvGX0BoOw0bhpFrzoYCX_at_mail.gmail.com...
> On Mon, Oct 11, 2010 at 7:43 AM, Domagoj Saric
> <domagoj.saric_at_[hidden]> wrote:
>> However this still does nothing concerning the exceptions vs
>> no-exceptions
>> comparison/debate because the compiler still has to treat
>> function<>::operator() as a possibly throwing function (and add/generate
>> appropriate EH code in/for the callers) because it makes an indirect call
>> through a (undecorated) pointer...
>
> If you don't disable exception handling, the compiler must treat the
> dynamic call in boost::function as potentially throwing. There is no
> way around that.

Of course there is, as I've shown performance difference results (repeated
link http://lists.boost.org/Archives/boost/2010/01/160908.php) that also
include data for the case when the 'way around' is turned on...
The way around, as David has hinted, is the decoration of the pointer itself
or the operator() (MSVC++ __declspec( nothrow ), GCC __attribute__((
nothrow )), c++1x noexcept, non-standard/'optimized' throw()...)...

--
"What Huxley teaches is that in the age of advanced technology, spiritual
devastation is more likely to come from an enemy with a smiling face than
from one whose countenance exudes suspicion and hate."
Neil Postman 

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