Boost logo

Boost :

From: Niels Dekker - mail address until 2008-12-31 (nd_mail_address_valid_until_2008-12-31_at_[hidden])
Date: 2008-05-05 14:08:21


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 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk