title: Why don't standard libraries implement std::atomic for structs under 8 bytes in a lock-free manner?
body: <p>Assuming that the architecture can support 8 byte scalars in a lock free manner for std::atomic.  Why don't standard libraries provide similar specializations for structs that are under 8 bytes?</p>
  
  <p>A simple implementation of such an std::atomic specialization can just serialize/deserialize (with <code>std::memcpy</code>) the struct into the equivalent <code>std::uintx_t</code> where <code>x</code> is the width of the struct in bits (rounded off to the closest power of 2 that is larger than or equal to the width of the struct).  This would be well defined because these structs are required by std::atomic to be trivially copyable. </p>
  
  <p>Eg. <a href="https://godbolt.org/z/sxSeId" rel="noreferrer">https://godbolt.org/z/sxSeId</a>, here <code>Something</code> is only 3 bytes, but the implementation calls <code>__atomic_load</code> and <code>__atomic_exchange</code>, both of which use a lock table. </p>