title: Is there no race condition in the swap?
body: <p>Global:</p>
  
  <pre><code>std::atomic&lt;T*&gt; a, b;
  </code></pre>
  
  <p>In thread A:</p>
  
  <pre><code>// this like std::swap(a, b), but is it atomic?
  a.exchange(b.exchange(a));
  </code></pre>
  
  <p>In thread B:</p>
  
  <pre><code>T* p = a.load();
  doSomethine(p);
  </code></pre>