Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2003-10-25 09:15:27


On Fri, Oct 24, 2003 at 02:15:16PM -0500, David B. Held wrote:
> "Pavol Droba" <droba_at_[hidden]> wrote in message
> news:20031024171237.GP22941_at_lenin.felcer.sk...
> > [...]
> > So these are constraints. I don't know what kind of guarantie
> > can be implicated from them, except for those claims that I
> > have already stated.
> > [...]
>
> Well, what I should have mentioned, and what Dave implies
> in another post, is that half of exception safety analysis involves
> imposing requirements on your inputs. So first of all, you
> want to require that all component operations at least give you
> the basic guarantee. If that then gives you the basic guarantee
> for most of your algorithms, regardless of the actual types
> used, then you can just say: "For the following algorithms, the
> basic guarantee is ensured".
>
> In some cases, you can get a better guarantee by increasing
> the requirements. For instance, you might be able to get the
> strong guarantee by requiring that some operation be nothrow,
> and that operation might naturally be nothrow most of the time
> anyway (such as operator==). You might not have any cases
> like this, but it's worth keeping in mind.
>
> So basically, your table probably doesn't need to include every
> operation in every function. However, I think it does need to
> include every function, stating the minimum guarantee provided.
> Whether you want to state how to get a stronger guarantee or
> not is up to you. Usually, that means how to get the strong
> guarantee when you are only promising the basic (since the
> nothrow guarantee requirements are trivial to state).
>

Assume, that all algorithms in this library can provide the
basic guarantie if arguments fulfill this requirement too.
Is it enough to make put this statement on one place and
comment only functions with exceptional properties (i.e. those,
that can provide stronger guarantie for common argument types)?

It the previous is accptable, it might be also possible to
identify some groups of functions with the properties allowing
to give a stronger guarantie, under common conditions.

Thus having only a few exceptions for documenting explicitly.

Regards,

Pavol


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