Subject: Re: [boost] [move] [range] move algorithm (was: interest: the pass-by-value...)
From: Neil Groves (neil_at_[hidden])
Date: 2014-02-19 05:58:18
On Wed, Feb 19, 2014 at 1:55 AM, Eric Niebler <eniebler_at_[hidden]> wrote:
> On 02/18/2014 03:47 PM, Neil Groves wrote:
> > I therefore think there are a number of reasons to strongly disagree with
> > the notion that a move iterator must be an Input Iterator.
> Yes, it's safe to assume that moved-from objects are in some valid
> state. That's not the issue. The moved-from state is almost guaranteed
> to be different from the state the object had before the move. The issue
> here is that the *algorithms* don't expect values in the sequence
> changing out from under them. This breaks assumptions all over the
> place. Algorithms *will* give nonsensical results when called with move
> iterators. It's practically guaranteed.
I don't believe that it is strictly correct to state that algorithms fon't
expect values in the sequence changing out from under them. Where is this
specified? I believe that a correct program adhering to the results could
well be broken by the proposed change. I disagree that it is practically
guaranteed. I think there are potentially cases, particularly of user
algorithms, that could have problems despite being correct. I agree that
these are the minority of cases.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk