Boost logo

Boost Users :

From: Timmo Stange (ts_at_[hidden])
Date: 2007-02-16 16:55:21


Frank Mori Hess wrote:

> To be clear, what I'm saying is something like the following:
>
> operator()(Iterator begin, Iterator end)
> {
> *begin; // slot executes;
> *begin; // slot does not execute;
> Iterator next = begin;
> ++next;
> *begin; // slot executes again
> }

What I meant is that with "++next" you pass the position referred to by
"begin" and with "*begin" you reuse that position, which I interpret
as a second pass. I don't know what the standard exactly says and I
don't have a copy here, but I'm quite sure the same wouldn't work with
a lot of input iterators that are widely used. You at least couldn't
rely on getting the value you expect with an istream_iterator, for
example.

Regards

Timmo Stange


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net