
On Tue, Oct 12, 2010 at 7:22 PM, Emil Dotchevski <emil@revergestudios.com> wrote:
On Tue, Oct 12, 2010 at 4:04 PM, Daniel Walker <daniel.j.walker@gmail.com> wrote:
Formally, boost::function invocation has strong exception safety if invoking the target function has strong exception safety.
This makes no sense at all. Invoking boost::function always has strong exception safety guarantee. In no way it can make the state of the boost::function object inconsistent, because it does not modify its state.
The target function could dereference a null pointer, which would not only modify the state of boost::function, it would modify the state of the entire system by bringing it to an abrupt halt. So, to be formal, a call to boost::function::operator() will only complete successfully or throw an exception if the target function completes successfully or throws an exception. However, I think, informally, we can leave it unspoken but understood that boost::function's behavior depends on the target function. Daniel Walker