Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2004-07-17 02:48:54


David Abrahams wrote:
> [...]
> It's fair game to:
>
> 1. Explain in one place what it means to read elements from an input
> sequence and create a new sequence and copy elements to it, and
>
> 2. Just say that to_lower_copy gives the strong guarantee, with the
> understanding that the algorithm has no control over what the
> input sequence does and so any side effects it causes are
> outside what's described by these requirements.
>
> That's the basic tack taken by the standard. No, it doesn't spell
> everything out in agonizing detail for each function. On the other
> hand, the specification is understandable, and actually is very
> explicit unless user-supplied operations have very unusual behaviors.

If all the functions which offer the strong guarantee have the same
form of creating a local and operating on that, then I agree that
a central explanation is probably best. I'm a little dissatisfied with
2, because it implies that using something like an istream iterator
will no longer give you the strong guarantee, but it doesn't come right
out and say so. Probably nobody will assume beforehand that anything
else would be the case, but it seems that it would be more clear just
to say that if your iterators or c'tors have side effects, then you
no longer get any guarantees at all.

Dave


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