title: What are some uses of decltype(auto)?
body: <p>In c++14 the <code>decltype(auto)</code> idiom is introduced. </p>
  
  <p>Typically its use is to <strong>allow <code>auto</code> declarations to use the <code>decltype</code> rules on the given expression</strong>. </p>
  
  <p>Searching for examples of "good" usage of the idiom I can only think of things like the following (by <a href="http://scottmeyers.blogspot.gr/2013/07/when-decltype-meets-auto.html" rel="noreferrer">Scott Meyers</a>), namely for <strong>a function's return type deduction</strong>:</p>
  
  <pre><code>template&lt;typename ContainerType, typename IndexType&gt;                // C++14
  decltype(auto) grab(ContainerType&amp;&amp; container, IndexType&amp;&amp; index)
  {
    authenticateUser();
    return std::forward&lt;ContainerType&gt;(container)[std::forward&lt;IndexType&gt;(index)];
  }
  </code></pre>
  
  <p>Are there any other examples where this new language feature is useful?</p>