I read a blog post by Alex Muscar, “Beautiful Binary Search in D“. It describes a binary search called “Shar’s algorithm”. I’d never heard of it and it’s impossible to google, but looking at the algorithm I couldn’t help but think “this is branchless.” And who knew that there could be a branchless binary search? So I did the work to translate it into a algorithm for C++ iterators, no longer requir
![Beautiful Branchless Binary Search](https://cdn-ak-scissors.b.st-hatena.com/image/square/04b3bf27664847e2a339077a72321e0a4a41a8b3/height=288;version=1;width=512/https%3A%2F%2Fprobablydance.files.wordpress.com%2F2023%2F04%2Fstrings.png)