title: Move or Named Return Value Optimization (NRVO)?
body: <p>Lets say we have the following code:</p>
  
  <pre><code>std::vector&lt;int&gt; f()
  {
    std::vector&lt;int&gt; y;
    ...
    return y;
  } 
  
  std::vector&lt;int&gt; x = ...
  x = f();
  </code></pre>
  
  <p>It seems the compiler has two approaches here:</p>
  
  <p>(a) NRVO: Destruct x, then construct f() in place of x.<br>
  (b) Move: Construct f() in temp space, move f() into x, destruct f().</p>
  
  <p>Is the compiler free to use either approach, according to the standard?</p>