------- Comment #10 from Woebbeking at web dot de  2006-01-30 07:07 -------
Subject: Re:  std::advance() isn't stable for floating point numbers

On Monday 30 January 2006 02:09, pcarlini at suse dot de wrote:
> ------- Comment #9 from pcarlini at suse dot de  2006-01-30 01:09
> ------- (In reply to comment #7)
>
> > reading the standard specification let me under the impression that
> > Distance is supposed to "related" to difference_type.  For example
> > the distance between the p before and after calling distance(p, n)
> > is supposed to be n.  So I would suggest conversion to the
> > difference_type of the iterator as a momentary resolution.
>
> Excellent idea.

FYI, I suggested tests for > 0 and < 0 as MSVC 7.1 does it that way. 

If you convert Distance to difference_type the question is what happens 
if Distance is i.e. 0.2. Do you advance by 0 or 1 position?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26020

Reply via email to