|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2001-05-18 12:47:51
----- Original Message -----
From: "Gary Powell" <Gary.Powell_at_[hidden]>
> leaves the class in an incomplete copied state. IMO that's unacceptable
for
> the general case.
I'm pretty sure that's untrue in the numeric application domains where these
objects will be applied.
> But I'm willing to be called confused. And the point is well taken.
>
> How about a comment in the docs to the effect that assignment does not
have
> the strong exception guarantee? After all quatarions are used in graphics
> applications and speed is the issue. (In which case the test for self
> assignment should definitely go.)
I agree with all but the first part of that.
We need a boost policy regarding which exception guarantee is the default.
My preference is that the basic guarantee is the default, and you should
document it anytime a library supplies stronger guarantees. Part of this
preference is pragmatic: I think most sanely-written code provides the basic
guarantee with little extra thought, so most of boost does that already. If
we pick the strong guarantee as the default, it will require a massive
review of all boost code and probably lots of new documentation ("basic
guarantee only" over and over).
Getting the strong or no-throw guarantee often has to be done very
consciously, and should be provided intentionally. The places where stronger
guarantees "appear for free" shouldn't lock a developer into providing it in
all future revisions just because s/he forgot to mention that the only
intended guarantee was basic.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk