
Herve Bronnimann wrote:
Johan: you can construct an iterator wrapper that map operator++ to next(float), and then it *really* is the specialization of std::distance() for this iterator type. In my opinion, difference implies an algebraic structure (which there is on float, but not what you want). I hope this convinces you that distance is the right name.
I very much like the idea of having an iterator wrapper, mapping operator++ to next(float). Actually I once wrote such an iterator myself :-) Would it be worth adding such a "float_iterator" to Boost? If so, the "upl distance" function could simply be called "operator minus" :-) float_iterator::difference_type operator-( const float_iterator & lhs, const float_iterator & rhs); BTW, I was thinking of having a template, basic_float_iterator<T>, for T being either float or double... Kind regards, -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center