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.