title: What optimization does move semantics provide if we already have RVO?
body: <p>As far as I understand one of the purposes of adding  move semantics is to optimize code by calling special constructor for copying "temporary" objects. For example, in <a href="https://stackoverflow.com/questions/3106110/can-someone-please-explain-move-semantics-to-me/3109981#3109981">this</a> answer we see that it can be used to optimize such <code>string a = x + y</code> stuff. Because x+y is an rvalue expression, instead of deep copying we can copy only the pointer to the string and the size of the string. But as we know, modern compilers support <a href="http://en.wikipedia.org/wiki/Return_value_optimization" rel="noreferrer">return value optimization</a>, so without using move semantics our code will not call the copy constructor at all.</p>
  
  <p>To prove it I write this code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  struct stuff
  {
          int x;
          stuff(int x_):x(x_){}
          stuff(const stuff &amp; g):x(g.x)
          {
                  std::cout&lt;&lt;"copy"&lt;&lt;std::endl;
          }
  };   
  stuff operator+(const stuff&amp; lhs,const stuff&amp; rhs)
  {
          stuff g(lhs.x+rhs.x);
          return g;
  }
  int main()
  {
          stuff a(5),b(7);
          stuff c = a+b;
  }
  </code></pre>
  
  <p>And after executing it in VC++2010 and g++ in optimize mode I'm getting empty output. </p>
  
  <p>What kind of optimization is it, if without it my code still works faster? Could you explain what I'm understanding wrong?</p>