In other words, is std::atomic<int>
guaranteed to hold only a single int
value?
No.
Per Paragraph 29.5/9 of the C++11 Standard:
[ Note: The representation of an atomic specialization need not have the same size as its corresponding argument type. Specializations should have the same size whenever possible, as this reduces the effort required to port existing code. —end note ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With