That's a thought, but it only works if the iterator starts at either end, not if it's created using lookup with a key. Seems like the proper design is to have both ordered and unordered iterators, and then look at each iterator creating operation individually to see whether it can return an ordered iterator or not.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-03 00:18: Subject: Re: Proposal for new ADT interface
If
- the underlying collection is unmodified, and
- the size of the collection is known
then it should be easy to associate an integer with each of the iterators. And comparison will do the right thing, if both iterators order the collection in a consistent way.
/ Niels Möller ()