You still have the possibillity to use (i != j) on an unordered iterator to avoid infinite loops
/ Peta, jo det är jag
Previous text:
2002-11-02 23:25: Subject: Re: Proposal for new ADT interface
What if you'd want to write code like
foo(collection c) { iterator i, j;
for (i = c->start(), j = j->end(); i<j; i++, j++) do_something_interesting(); // ^ iterator comparison }
I think there should be some way to do that for any collection, ordered or not. It may do unexpected things if do_something_interesting() makes changes to the collection (that's a general problem I'm not sure how it is best solved), but it should degrade in an ordered fasshion, e.g. it shouldn't turn into an infinite loop.
/ Niels Möller ()