This question here indicates that std::atomic<T>
is generally supposed to have the same size as T
, and indeed that seems to be the case for gcc, clang, and msvc on x86, x64, and ARM.
In an implementation where std::atomic<T>
is always lock free for some type T
, is it's memory layout guaranteed to be the same as the memory layout of T
? Are there any additional special requirements imposed by std::atomic
, such as alignment?
Aucun commentaire:
Enregistrer un commentaire