std::bitset has a to_string() method for serializing as a char-based string of 1s and 0s. Obviously, this us
std::bitset
to_string()
char
1
0
As suggested by guys at gamedev.net, one can try using boost::dynamic_bitset since it allows access to internal representation of bitpacked data.