Boost logo

Boost :

Subject: Re: [boost] [function] function wrapping with no exception safetyguarantee
From: Emil Dotchevski (emil_at_[hidden])
Date: 2010-10-13 13:31:04


On Wed, Oct 13, 2010 at 9:41 AM, Daniel Walker
<daniel.j.walker_at_[hidden]> wrote:
> In "promoting" function pointers to function objects, boost::function
> must transfer the call precondition from function pointers. To do this
> in an exception safe way, it must check whether the call precondition
> is met, otherwise it cannot offer a strong exception safety guarantee
> during the execution of boost::function::operator().

What Peter said: your terminology is wrong.

Operator() of boost::function has basic (not strong) exception safety
guarantee and this is true regardless of whether it wraps a function
pointer or another callable object.

Basic exception safety guarantee means that *if* an exception is
emitted as a result of calling boost::function::operator(), the state
of the program may be altered but no resources will leak. Whether or
not an exception is emitted has nothing to do with exception safety.

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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