Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-04-16 18:25:59


Am Mittwoch, 11. April 2007 19:25 schrieb Neal Becker:
> If it1 == it2,
> then it1.index () == it2.index ().
> If it1 == it2,
> then it1.index () < (++ it2).index ().
> If it1 == it2,
> then it1.index () > (-- it2).index ().
>
> Shouldn't that be:
> If it1 == it2,
> then it1.index () == it2.index ().
> If it1 <= it2,
> then it1.index () < (++ it2).index ().
> If it1 >= it2,
> then it1.index () > (-- it2).index ().

No, the upper statement only requires the indices to be sorted and the
iterators to be equality-comparable. The lower statement additionally
requires the iterators to be less-than-comparable which is stricter.
However these checks will fail when it2 is at begin() or one step
before end().

mfg
Gunter