I have a bitset of any size and I would like to know the fastest way to get a list of 64 bits bitsets from my original bitset ?
For example, from bitset<10000> b('010001110 ...')
, I would like to get a list of 64 bits bitsets containing the 1st 64th bits, then the next 64th bits from my original bitset, and so on.
Sadly, there isn't any functionality to efficiently do this operation straight from the STL. You'd have to go bit by bit or you can shift and mask, as explained in this answer.
However, giving credit to this
You can use boost::dynamic_bitset, which can be converted to a range of "blocks" using boost::to_block_range.