D-Programming-Language/phobos — pull request #1901 by Poita (2014-02-02 12:53:14+00:00)
Title: Fix Issue 12027 - Iterate set bits in BitArray.

Also adds:
- countTrailingZeros(v)
- countBitsSet(v)
- bitsSet(v)

Notes:
- There is a `popcnt` function in `core.bitops`, but it only works with `int`.
- `bitsSet(v)` could be a bidirectional and possibly even random access range, but I'll leave that for future work for now.

https://d.puremagic.com/issues/show_bug.cgi?id=12027