boostorg / range

Boost.org range module
http://boost.org/libs/range
42 stars 101 forks source link

[doc] Clarify that iterator_range and sub_range may also model refinements of Forward Range concept. #1

Closed m-w-a closed 10 years ago

HighCommander4 commented 10 years ago

I agree that it is clear that if iterator_range is documented as requiring ForwardIterators as its input, then it also accepts BidirectionalIterators and RandomAccessIterators.

What is not clear is that the resulting range class models BidirectionalRange if the inputs model BidirectionalIterators, and RandomAccessRange if the inputs model RandomAccessIterators. I could easily imagine a simpler iterator_range class which always just modelled ForwardRange even if it were given more refined iterators. Therefore, I think this is worth documenting.