Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Iterator questions
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-07-24 00:29:10



> What is the traversal type? Random access is _possible_ just not efficient. To move
> forward n locations it has to increment n times. ++ and −− are fine. There is indeed a
> well defined distance between two iterators, but I don't want to encourage that kind of
> thing and hide the inefficiency. But, I see that relational operators are defined for
> random access (only), not for bidirectional? Why is that? Note that relational operators
> for the proposed type _are_ efficient, as it can defer to the underlying iterator. I
> knows which is greater, just not by how much exactly.

Interesting problem!
 
Would it work to make it bidirectional, and then define your own relational
operators?
 
Regards,
Nate.


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