Boost logo

Boost Users :

Subject: Re: [Boost-users] iterator_facade and distance()
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-04-16 10:12:39


At Sat, 16 Apr 2011 21:35:29 +0900,
Andrej van der Zee wrote:
>
> Hi Dave,
>
> Thank you for your email.
>
> >
> > You misspelled "distance_to."  Fix the spelling and it should work better.
> >
>
> Indeed a typo. Unfortunately, changing it to the method below does not
> change anything. The method is never called even though I explicitly
> call std::distance(), which, I assume, should call eventually
> distance_to(),
>
> facade_t::difference_type distance_to(const
> data_stream::const_iterator & to) const
> {
> abort();
> }

Not unless yours is a random access iterator. Is it?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net