title: Why isn't atomic double fully implemented
body: <p>My question is quite simple. Why isn't <code>std::atomic&lt;double&gt;</code> <a href="http://en.cppreference.com/w/cpp/atomic/atomic" rel="noreferrer">implemented completely</a>? I know it has to do with atomic RMW (read-modify-write) access. But I really don't see, why this shouldn't be possible on a <code>double</code>.</p>
  
  <p>It's specified that any <a href="http://www.cplusplus.com/reference/type_traits/is_trivially_copyable/" rel="noreferrer">trivially copyable</a> type can be used. And of course <code>double</code> is among them. So C++11 requires the basic operations (load, store, CAS, exchange, etc.) that you can use with any class type.</p>
  
  <p>However, on integers an extra set of operations is possible (<code>fetch_add</code>, <code>++</code>, <code>+=</code>, etc).</p>
  
  <p>A <code>double</code> differs very little from these types. It's native, trivially copyable, etc. Why didn't the standard include the <code>double</code> with these types?</p>
  
  <hr>
  
  <p>Update: C++20 does specialize <code>std::atomic&lt;T&gt;</code> for floating-point types, with fetch_add and sub.  <a href="https://stackoverflow.com/questions/58680928/c20-stdatomicfloat-stdatomicdouble-specializations">C++20 std::atomic&lt;float&gt;- std::atomic&lt;double&gt;.specializations</a>  But not atomic absolute-value (AND) or negate (XOR).</p>
  
  <p>Editor's note: Without C++20 you can roll your own out of CAS; see <a href="https://stackoverflow.com/questions/45055402/atomic-double-floating-point-or-sse-avx-vector-load-store-on-x86-64">Atomic double floating point or SSE/AVX vector load/store on x86_64</a> for portable examples; <code>atomic&lt;double&gt;</code> and float are lock-free on most C++ implementations.</p>