
2014-02-19 12:10 GMT+01:00 Neil Groves
Why in the world does a stride iterator need to be random-access? Here is a strided range adaptor that works with input iterators:
https://github.com/ericniebler/range-v3/blob/ master/include/range/v3/view/stride.hpp
It's not even hard.
I guess it may have been because it was the easiest. I see you have special handling of bidirectional iterators. Anyway, nice to see your improvements. :-)
I think this implies that the current implementation in Boost.Range doesn't optimise for bidirectional and random-access which is wrong. My implementation requires at least a single-pass traversal but handles bidirectional and random-access fine.
Do we need a new Value Access Concept [1] for this: Readable Once Iterator? The Iterator Traversal [2] is independent from Value Access. Regards, Kris [1] http://www.boost.org/doc/libs/1_55_0/libs/iterator/doc/new-iter-concepts.htm... [2] http://www.boost.org/doc/libs/1_55_0/libs/iterator/doc/new-iter-concepts.htm...