title: Why isn't move constructor called?
body: <p>The Standard provides an example regarding to the a move constructor. There is what it says:</p>
  
  <blockquote>
    <p>A non-template constructor for class <code>X</code> is a move constructor if its
    first parameter is of type <code>X&amp;&amp;</code>, <code>const X&amp;&amp;</code>, <code>volatile X&amp;&amp;</code>, or <code>const</code>
    <code>volatile X&amp;&amp;</code>, and either there are no other parameters or else all
    other parameters have default arguments (8.3.6).</p>
  </blockquote>
  
  <p>I was trying to run some an experiments with an example the Stadard provides:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;limits&gt;
  
  
  struct Y {
      Y(){ std::cout &lt;&lt; "Y()" &lt;&lt; std::endl; };
      Y(const Y&amp;){ std::cout &lt;&lt; "Y(const Y&amp;)" &lt;&lt; std::endl; };
      Y(Y&amp;&amp;){ std::cout &lt;&lt; "Y(const Y&amp;&amp;)" &lt;&lt; std::endl; };
  };
  
  Y f(int)
  {
      return Y();
  }
  
  Y d(f(1)); // calls Y(Y&amp;&amp;)
  Y e = d; // calls Y(const Y&amp;)
  
  int main(){ }
  </code></pre>
  
  <p><a href="http://coliru.stacked-crooked.com/a/2d1cfa278067b51c" rel="nofollow noreferrer"><strong>DEMO</strong></a></p>
  
  <p>But instead copy constructor was called. Why that?</p>