Is this type of operation considered safe? (in other words no chance of reading some bogus intermediate value if the bitset is being modified on a different thread)? Specifically I'm only interested in whether the read is safe, in other words, I am not asking whether it's safe to write to a bitset from two separate threads.
eg: Will thread 1 reliably get the current state of bit 5 regardless of whether other bits in bs are being set/cleared at the same time?
std::bitset<64> bs;
//thread 1:
bool val;
val=bs.test(5);
// ...
//thread 2:
// set/clear a few bits
bs.set(1);
bs.set(3);
bs.set(5);
bs.reset(6);
// ...