(when `== on the data elements are true?).
Rather when a < b and a > b are both false. But that's right; even in ordered collections it would be wise to keep an integer position in the iterators as often as possible.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-03 15:55: Subject: Re: Proposal for new ADT interface
Well, that could require an element walk through in some cases, e.g. in the new multiset implementation, which would be more expensive. Anyway, if there is an order then "before" should always be the same as "less" so it doesn't matter much.
Yes. Since the multiset order is known, it can very well cheat and only do walking when needed (when `== on the data elements are true?).
Giving an error when the iterators aren't comparable seems like a good behaviour (iterators from different or edited multisets or mappings, for instance), since doing < and > comparison on those are bound to be a mistake.
Any plans on a Heap, btw?
/ Brevbäraren