Boost logo

Boost :

Subject: Re: [boost] Proposed new RAII Library
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-09-14 17:44:54

On Friday 14 September 2012 21:25:44 Andrew Sandoval wrote:
> It's a better solution for most things, but there are cases where
> RAIIFunction with a lambda or a function produced by bind are more
> desirably, and the user will need to understand the risks -- which in the
> large major of cases are next to nil anyway, before they elect to use
> RAIIFunction.

The probability of exception doesn't matter. Scope guards (or RAIIFunction)
are typically used to implement exception safety, so introducing the
possibility of exception from the scope guard itself sort of defeats its
purpose. At the very least, it will complicate usage - probably, more than it
will simplify one. IMHO, this tool should not be based on boost/std::function.

Boost list run by bdawes at, gregod at, cpdaniel at, john at