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 ()
Previous text:
2002-11-02 23:11: Subject: Re: Proposal for new ADT interface
Not really. If you have an unordered set you might get two iterators that iterates over all members in different order.
/ Martin Nilsson (Fake Build Master)