so since we don't have a proper search till c++20:
ix.io/3nAa/cpp
gotta love the do-if-while.

shame ix.io html doesn't highlight the if though, so maybe
curl ix.io/3nAa+cpp
instead.

the rage type is just a simple aggregate that holds the two iterators and provides the usual begin-end interface, no magic there.

Follow

of course I notice a horrible out of bound read right after positng -_-

but it passed the tests, even with address sanitizer :v

because tests were on c-strings that and null terminators saved them -_-

fixed
ix.io/3nAq/cpp

but now it look a lot more like the cppreference example implementation... so much for trying to be original and stylish...

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.