Boost logo

Boost Users :

Subject: Re: [Boost-users] iterator_facade and distance()
From: Andrej van der Zee (andrejvanderzee_at_[hidden])
Date: 2011-04-16 19:43:00


Hi Dave,

Thanks for your email.

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

Its a forward iterator. Changing it to a random access iterator solves
it indeed.

This is my first iterator that I am writing, but why is it not
possible to implement a custom distance method for forward iterators?
Am I doing something conceptually wrong? Or should I specialize the
std::distance() function?

Thank you,
Andrej


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