Re: [PATCH] libstdc++: Fix ranges::search_n for random access iterators [PR97828]

2020-11-17 Thread Jonathan Wakely via Gcc-patches
On 16/11/20 15:25 -0500, Patrick Palka via Libstdc++ wrote: My ranges transcription of the std::search_n implementation for random access iterators missed a crucial part of the algorithm which the tests unfortunately didn't catch. When __remainder is less than __count at the start of an iteratio

[PATCH] libstdc++: Fix ranges::search_n for random access iterators [PR97828]

2020-11-16 Thread Patrick Palka via Gcc-patches
My ranges transcription of the std::search_n implementation for random access iterators missed a crucial part of the algorithm which the tests unfortunately didn't catch. When __remainder is less than __count at the start of an iteration of the outer while loop, it means we're continuing a run of