I've been using the bitset the following way:
unsigned long value = 0;
bitset<size> myBitset(value);
// do something with the bitset
value = myBitset.to_ulong();
Is there a way to avoid using the last line and affect the value's bits from the bitset directly?