title: Does returning a reference extend its lifetime too?
body: <p>AFAIK, in the following code the lifetime of the reference <code>ro1</code> is extended till the end of the scope (function <code>g()</code>):</p>
  
  <pre><code>class Some {
    // Implementation here
  };
  Some f() {
    return Some(/* constructor parameters here*/);
  }
  void g() {
    Some&amp;&amp; ro1 = f();
    // ro1 lives till the end of this function
  }
  </code></pre>
  
  <p>How about returning this reference? Will the object still live in <code>g1()</code>, or will it be destructed upon the exit from <code>h()</code>?</p>
  
  <pre><code>Some&amp;&amp; h() {
    Some&amp;&amp; ro1 = f();
    // Code skipped here
    return std::forward&lt;Some&gt;(ro1);
  }
  
  void g1() {
    Some&amp;&amp; ro2 = h();
    // Is ro2 still refering to a valid object?
  }
  </code></pre>