That's a cool solution. I noticed that this function isn't listed in the index page for std.algorithm: https://dlang.org/phobos/std_algorithm.html so it's a little hard to find. Apparently it's a bug in the documentation. Long-time lurker here, btw.