title: Is a function return-value constant by default (an rvalue)?
body: <p>I'm learning about rvalue references, and the tutorial told me this:</p>
  
  <blockquote>
  <pre><code>X foo();
  X x;
  x = foo();
  </code></pre>
    
    <p>Rather obviously, it would be ok, and much more efficient, to swap resource pointers (handles) between x and the
    temporary, and then let the temporary's destructor destruct x's original resource. </p>
    
    <p>In other words, <strong>in the special case where the right hand side of the
    assignment is an rvalue</strong>, we want the copy assignment operator to act
    like this.</p>
  </blockquote>
  
  <p>So, does this mean that return values from functions are always constant by default, and thereby an rvalue? If yes: Are they always constant, or are there exceptions too?</p>