title: Which to use: move assignment operator vs copy assignment operator
body: <p>I don't seem to get why would you use the <code>move assignment operator</code>:</p>
  
  <pre><code>CLASSA &amp; operator=(CLASSA &amp;&amp; other); //move assignment operator
  </code></pre>
  
  <p>over, the <code>copy assignment operator</code>:</p>
  
  <pre><code>CLASSA &amp; operator=(CLASSA  other); //copy assignment operator
  </code></pre>
  
  <hr>
  
  <p>The <code>move assignment operator</code> takes an <code>r-value reference</code> only e.g.</p>
  
  <pre><code>CLASSA a1, a2, a3;
  a1 = a2 + a3;
  </code></pre>
  
  <p>In the <code>copy assignment operator</code>, <code>other</code> can be constructor using a <code>copy constructor</code> or a <code>move constructor</code> (if <code>other</code> is initialized with an rvalue, it could be move-constructed --if <code>move-constructor</code> defined--). </p>
  
  <p>If it is <code>copy-constructed</code>, we will be doing 1 copy and that copy can't be avoided. </p>
  
  <p>If it is <code>move-constructed</code> then the performance/behavior is identical to the one produced by the first overload.</p>
  
  <p>My questions are:</p>
  
  <p>1- Why would one want to implement the <code>move assignment operator</code>. </p>
  
  <p>2- If  <code>other</code> is constructed from an r-value then which <code>assignment operator</code> would the compiler choose to call? And why?</p>