Maybe std::bitset can be useful?

Regards,
Guido