Boost logo

Boost :

Subject: Re: [boost] [algorithm] adjacent_for_each interest?
From: Dave Abrahams (dave_at_[hidden])
Date: 2013-02-11 12:52:03

on Mon Feb 11 2013, Evgeny Panasyuk <> wrote:

> 11.02.2013 3:09, Dave Abrahams:
>>> In this regard your version at
>>> is broken.
>>> Because it advertises to work on InputIterator, but it dereferences
>>> iterator at same position several times. As the result current
>>> implementation is for ForwardIterator.
>> That's incorrect. The mental model for InputIterator is an ephemeral
>> input stream *with a one-element backing buffer*. You are allowed to
>> dereference the same InputIterator multiple times at the same position
>> until that iterator or a copy of it is incremented.
> Thanks for correction, I should re-phrase my sentence as:
> "but it dereferences iterator at same position several times *after
> passing to next and/or dereferencing it*" (
> )

OK, but the last part of that sentence remains irrelevant. It should
end with the word "next."

Dave Abrahams

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