tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
441 stars 28 forks source link

take_while should not be random-access #155

Open tcbrindle opened 5 months ago

tcbrindle commented 5 months ago

This was one of the very first adaptors and I just adapted my ranges implementation without thinking about it too much. But how can we bounds check if we don't know where the end is?

tcbrindle commented 5 months ago

(An "after pred() has returned false" read isn't going to be UB as the access to the underlying sequence is still going to be bounds checked, but we should still catch this.)