title: Return values in c++03 vs 11
body: <p>I have spend a few hours about <em>rvalue</em> s and lvalue. Here is what I understand</p>
  
  <pre><code>int main()
  {
    //.....
    Foo foo = Bar1();
    foo = Bar2();
    //......
  }  
  
  Foo Bar1()
  {
    //Do something including create foo
    return foo;
  }
  
  Foo&amp; Bar2()
  {
    //Do something including create foo
    return foo;
  }
  </code></pre>
  
  <p>Under c++03, <code>Bar1()</code> would copy the return object (just before return), and then return the address of the copied object; executing a wasteful copy of an object which is about to be destroyed. <code>Bar2()</code> would return the object created within the function. </p>
  
  <p>Under c++11, <code>Bar1()</code> and <code>Bar2()</code> would essentially be equivalent (and also equivalent to <code>Bar2()</code> of c++03).</p>
  
  <p>Is that right? If not, please elaborate.</p>