“Prefer Algorithms to Hand-Written Loops”
The title of this post refers to an oft-repeated C++ dictum — one that I’ve resisted for most of my C++ career. I tried doing things that way, several times, but in the end I always went back to hand-written loops. That changed recently; read on to see why, and more importantly, how.