Now that we got talking about searching in arrays, allow me to also share an idea I've had a short while ago.
I wrote a range-based implementation to see how it would look like.
https://gist.github.com/JakobOvrum/45a37f55ba5c9a7501d6 The tests are very thin but it seems to do the trick.
