Does the standard say that sizeof(std::atomic<T>)
is equal to sizeof(T)
?
(I'm investigating building union of atomic and other types for use across an ABI that ideally should not have STL types. If the sizes are identical then this could work).
[atomics.types.generic]/p9
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
No, you can't assume that. It's a best-effort endeavor but no guarantees.
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