title: Perfect-forwarding a return value with auto&&
body: <p>Consider this quote from <em>C++ Templates: The Complete Guide (2nd Edition)</em>:</p>
  
  <blockquote>
  <pre><code>decltype(auto) ret{std::invoke(std::forward&lt;Callable&gt;(op),
                                 std::forward&lt;Args&gt;(args)...)};
  ...
  return ret;
  </code></pre>
    
    <p>Note that declaring <code>ret</code> with <code>auto&amp;&amp;</code> is not correct. As a
    reference, <code>auto&amp;&amp;</code> extends the lifetime of the returned value until
    the end of its scope <strong>but not beyond the <code>return</code> statement to the
    caller of the function</strong>.</p>
  </blockquote>
  
  <p>The author says that <code>auto&amp;&amp;</code> is not appropriate for perfect-forwarding a return value. However, doesn't <code>decltype(auto)</code> also form a reference to xvalue/lvalue?
  IMO, <code>decltype(auto)</code> then suffers from the same issue. Then, what's the point of the author?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The above code snippet shall go inside this function template.</p>
  
  <pre><code>template&lt;typename Callable, typename... Args&gt;
  decltype(auto) call(Callable&amp;&amp; op, Args&amp;&amp;... args) {
      // here
  }
  </code></pre>