List Info

Thread: typo in iterator_concepts doc?




typo in iterator_concepts doc?
user name
2007-04-11 12:25:43
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 ().


_______________________________________________
ublas mailing list
ublaslists.boost.org
htt
p://lists.boost.org/mailman/listinfo.cgi/ublas

Re: typo in iterator_concepts doc?
user name
2007-04-16 17: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

_______________________________________________
ublas mailing list
ublaslists.boost.org
htt
p://lists.boost.org/mailman/listinfo.cgi/ublas

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )