Open sarah-ek opened 3 years ago
The situation is worse, the values pointed to by it2
as it's decremented are not in the zipped range at all.
Maybe zip
shouldn't be a common range?
For random access , I would expect to either have a runtime check, that both ranges have the same size or just the min of the two. Consequently rng.end()
should point at (5/(one-past-4)). Harder to say what should happen for cases, where the bases are bidirectional ranges.
one potential solution would be to "align" the end iterators (and maybe cache the result?) when end
is computed, if the ranges are all sized.
if the ranges aren't sized, their zipped range could be a forward range instead.
forward_iterator
requiresequality_comparable
, which says that equality must be transitive. this can be violated if we obtain the end iterator and decrement it until we reach the beginning of the range.