Is there a way to extract a CPU word size long subsequence of bits from a bitset efficiently without iterating over each bit individually? Something like
#include <bitset>
#include <iostream>
using namespace std;
int main() {
bitset<100> b;
// Do something with b
// ...
// Now i want sizeof(long) many bits starting at position 50
unsigned long l = (b>>50).to_ulong();
}
would do if it would truncate the bitstring instead of throwing an exception!