title: Implementing Move Constructor by Calling Move Assignment Operator
body: <p>The MSDN article, <a href="http://msdn.microsoft.com/en-us/library/dd293665.aspx" rel="noreferrer">How to: Write a Move Constuctor</a>, has the following recommendation.</p>
  
  <blockquote>
    <p>If you provide both a move constructor and a move assignment operator for your class, you can eliminate redundant code by writing
    the move constructor to call the move assignment operator. The
    following example shows a revised version of the move constructor that
    calls the move assignment operator:</p>
  </blockquote>
  
  <pre><code>// Move constructor.
  MemoryBlock(MemoryBlock&amp;&amp; other)
     : _data(NULL)
     , _length(0)
  {
     *this = std::move(other);
  }
  </code></pre>
  
  <p>Is this code inefficient by doubly initializing <code>MemoryBlock</code>'s values, or will the compiler be able to optimize away the extra initializations? Should I always write my move constructors by calling the move assignment operator?</p>