title: C++11 move constructor
body: <p><br/>
  What would be the correct way to implement a move constructor considering the following class:</p>
  
  <pre><code>class C {
  public:
      C();
      C(C&amp;&amp; c);
  private:
      std::string string;
  }
  </code></pre>
  
  <p>Of course, the idea is to avoid copying <code>string</code> or deallocating it twice.<br/>
  Lets assume the basic example is just for clarity and I do need a move constructor.<p>
  <br/>I tried:</p>
  
  <pre><code>C::C(C&amp;&amp; c) {
      //move ctor
      string = std::move(c.string);
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>C::C(C&amp;&amp; c) : string(std::move(c.string)) {
      //move ctor
  }
  </code></pre>
  
  <p>Both compile fine on gcc 4.8 and run fine. It <em>seems</em> option A is the correct behaviour, <code>string</code> gets copied instead of moved with option B.<br/>
  Is this the correct implementation of a move constructor?</p>