Fast Resettable Flag Vector
upcoder.com
upcoder.com
Specifically, vector<bool>::clear() is not at all equivalent to bitset::reset()
I'm guessing if the size of the vector is very large, and the set bits are very sparse, then this threshold counter idea would be faster. But that would beg the question of why a bitset and tracked offsets (similar to the other idea mentioned in the article) wouldn't be fast either. Especially considering the caching effects of the bitset.