On Tuesday, 19 May 2015 at 05:16:48 UTC, Andrei Alexandrescu wrote: > Any ideas for faster code? Unless I'm mistaken, any uint that's a power of 2 will only have a single set bit, so why not use the "popcnt" instruction? http://dlang.org/phobos/core_bitop.html#.popcnt