title: Implicitly-declared move assignment operator
body: <p>I'm having trouble getting my head around this simple rule from cpp reference;</p>
  
  <blockquote>
    <p>If no user-defined move assignment operators are provided for a class
    type (struct, class, or union), and all of the following is true:</p>
    
    <p>there are no user-declared copy constructors;</p>
    
    <p>there are no user-declared move constructors; </p>
    
    <p>there are no user-declared copy assignment operators; </p>
    
    <p>there are no user-declared destructors; </p>
    
    <p>the implicitly-declared move assignment operator would not be defined 
    as deleted, (until C++14) </p>
    
    <p>THEN the compiler <strong>WILL</strong>  declare a move assignment operator as an inline public member of its class with the  signature T&amp; T::operator=(T&amp;&amp;).</p>
  </blockquote>
  
  <p>With this in mind, consider</p>
  
  <pre><code>struct bar
  {
  
     bar(int i) : _i(i) {};
     bar (const bar&amp; other) { };
     bar (bar&amp; other) { };
  
     int _i;
  };
  </code></pre>
  
  <p>Followed by this, say;</p>
  
  <pre><code>   bar b2(2);
     bar b3(3);
     cout &lt;&lt; "b3._i " &lt;&lt; b3._i &lt;&lt; endl &lt;&lt; endl;
     b3 = std::move(b2);
     cout &lt;&lt; "b3._i " &lt;&lt; b3._i &lt;&lt; endl;
  </code></pre>
  
  <p>The output we get is;</p>
  
  <p>b3._i 3</p>
  
  <p>b3._i 2</p>
  
  <p>So here we have a move happening;</p>
  
  <pre><code>b3 = std::move(b2);
  </code></pre>
  
  <p>I didn't define that move assignment operator, so its been implicitly defined for me by the compiler. However I <strong>have</strong> broken the conditions laid down, I HAVE a user defined copy ctor.... however there is still a move happening by the compiler generated one. I'm clearly misinterpreting the text, can anybody be so good as to enlighten me?</p>
  
  <p>Thanks and have a nice day.</p>
  
  <p>G</p>