v3 flag enabled

Find a battle-tested library for the problem you're solving right now.

Excited Cartoon Mascot Excited Cartoon Mascot
Dynamic Bitset

The dynamic_bitset template represents a set of bits. It provides access to the value of individual bits via operator[] and provides all of the bitwise operators that one can apply to builtin integers, such as operator& and operator<<. The number of bits in the set can change at runtime.

C++ 11