TartanLlama / ranges

Ranges that didn't make C++20
Creative Commons Zero v1.0 Universal
83 stars 5 forks source link

`cycle_view` should support non-common, sized, bidirectional ranges #3

Closed TartanLlama closed 3 years ago

TartanLlama commented 3 years ago

cycle_view currently requires bidirectional ranges to be common because it assigns std::ranges::end(base_) to current_ when it cycles from begin to end. Non-common, sized, bidirectional ranges should be supported.

Range-v3 supports non-common, non-sized bidirectional ranges by --begin(my_cycle_view) being O(n) unless end has been cached. I don't think we should do that.

TartanLlama commented 3 years ago

Done