Counts the number of bits set to expected.
expected
int count({bool expected = true}) => countRange(0, length, expected: expected);