title: Dereferencing a temporary unique_ptr
body: <pre><code>unique_ptr&lt;A&gt; myFun()
  {
      unique_ptr&lt;A&gt; pa(new A());
      return pa;
  }
  
  const A&amp; rA = *myFun();
  </code></pre>
  
  <p>This code compiles but <code>rA</code> contains garbage. Can someone explain to me why is this code invalid?</p>
  
  <p>Note: if I assign the return of <code>myFun</code> to a named <code>unique_ptr</code> variable before dereferencing it, it works fine.</p>