Is this type of operation safe? (in other words, there is no way to read some kind of fictitious intermediate value if the bitet changes to another stream)? In particular, I am only interested in whether reading is safe, in other words, I do not ask whether it is safe to record the bitrate from two separate streams.
for example: Will thread 1 reliably receive the current state of bit 5 regardless of whether the same bits are set to bs at the same time?
std::bitset<64> bs;
bool val;
val=bs.test(5);
bs.set(1);
bs.set(3);
bs.set(5);
bs.reset(6);
source
share