title: Can the return type of the function be obtained from within the function?
body: <p>Can the return type of a function be obtained in a simple way within the function?</p>
  
  <p>For example, given:</p>
  
  <pre><code>template &lt;typename P&gt;
  static inline auto foo(P p) -&gt; typename std::remove_reference&lt;decltype(*p)&gt;::type {
      typename std::remove_reference&lt;decltype(*p)&gt;::type f{};  // &lt;-- here
  
      ...
  }
  </code></pre>
  
  <p>In C++11 can I refer to the big nasty return type of <code>foo</code>, within <code>foo</code> itself, without repeating it, at the line marked <code>// &lt;-- here</code>?</p>