Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Iterator questions
From: John M. Dlugosz (mpbecey7gu_at_[hidden])
Date: 2011-07-24 02:34:33


On 7/23/2011 11:29 PM, Nathan Ridge wrote:
>

> Interesting problem!
>
> Would it work to make it bidirectional, and then define your own relational
> operators?
>

I would have no trouble defining the relational operators to just call the underlying
iterator's. It's just that various algorithms might not realize that it's possible, if
it's tagged with a type that implies that iterators can't be compared at all, other than
for equality.

Another thing I just realized: I was supposing that being read-only, I'll just make a
const_iterator but no non-const iterator. But inserting into a container takes an
iterator as the insertion position (not a const iterator).

So even with the advanced iterator concepts, the categories still don't match exactly, it
would seem.


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