title: How to typedef the return type of a method from a template class?
body: <p>I have a templated class <code>Helper</code> which looks like this:</p>
  
  <pre><code>template&lt; typename Mapper &gt;
  class Helper
  {
  public:
  
     using mappedType = ... ;
  
  };
  </code></pre>
  
  <p>I would need <code>mappedType</code> to be the type returned by the <code>map(const int&amp;)</code> method in the <code>Mapper</code> class. Given a valid type for <code>Mapper</code> like the following:</p>
  
  <pre><code>class DMapper
  {
  public:
  
      double map(const int&amp; val){ ... }
  };
  </code></pre>
  
  <p><code>Helper&lt;DMapper&gt;::mappedType</code> should be <code>double</code>. Is there a way to do that without instantiating a <code>Mapper</code>?</p>
  
  <p>The closest I got is:</p>
  
  <pre><code>using mappedType = typename std::result_of&lt;
      decltype(&amp;Mapper::map)(Mapper const*, const int&amp;)
  &gt;::type;
  </code></pre>
  
  <p>But <code>type</code> is not defined in this case.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>If I can avoid using a dummy argument for the <code>int</code>, that would be even better (in my concrete code, the argument is not that simple).</p>