title: atomic operations for shared_ptr in C++11
body: <p>By reading the c++11 draft <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf">n3242</a>, section 20.7.2.5, looks like we have atomic operations on shared_ptr, which enables us do lock-free on complicated structure without worrying about GC/memory leak.</p>
  
  <p>However, I couldn't use it successfully in GCC-4.7.0.  I simply tested the following program </p>
  
  <pre><code>#include &lt;atomic&gt;
  #include &lt;memory&gt;
  #include &lt;string&gt;
  
  struct X {
      int x;
      double y;
      std::string s;
  };
  
  int main() {
      std::shared_ptr&lt;X&gt; x(new X);
      auto p = std::atomic_load(&amp;x);
  }
  </code></pre>
  
  <p>and it has compiler error:</p>
  
  <pre><code>c.cpp:13:33: error: no matching function for call to ‘atomic_load(std::shared_ptr&lt;X&gt;*)’
  </code></pre>
  
  <p>Does anyone know what I missed here?  Or is it simply gcc hasn't implemented that yet?</p>