decltype for member functions <p>How can I get the return type of a member function in the following example?</p> <pre><code>template &lt;typename Getter&gt; class MyClass { typedef decltype(mygetter.get()) gotten_t; ... }; </code></pre> <p>The problem, of course, is that I don't have a "mygetter" object while defining MyClass.</p> <p>What I'm trying to do is: I'm creating a cache that can use, as it's key, whatever is returned by the getter.</p>