title: Why is the expected parameter to std::atomic::compare_exchange_xxx() not const &?
body: <p>I'm sure I'm about to have a face-palm moment, but here goes:</p>
  
  <p>The prototype for <code>std::atomic::compare_expected_*</code> is </p>
  
  <pre><code>bool compare_exchange_strong (T&amp; expected, T val,
         memory_order sync = memory_order_seq_cst) volatile noexcept;
  </code></pre>
  
  <p>Why is <code>expected</code> not a <code>const T &amp;</code>?</p>
  
  <pre><code>static const handle_t INVALID_HANDLE = 0;
  ...
  std::atomic&lt;handle_t&gt; handle(INVALID_HANDLE);
  ...
  handle.compare_exchange_strong(INVALID_HANDLE, newValue);
  </code></pre>
  
  <p>Surely the exchange methods don't need to modify the expected value?</p>