title: how to reference a typedef within a class with an instance of such class?
body: <p>Is there a way to get this code work, just like it does when calling a <em>static</em> function with the dot notation?</p>
  
  <pre><code>struct A{
      static void f(){ }
      typedef int t;
  };
  
  template&lt;typename T&gt; void f(){}
  
  int main(){
      A a;
      a.f();          //legit
      f&lt;a.t&gt;();       //‘a’ cannot appear in a constant-expression, ‘.’ cannot appear in a constant-expression
      a.t somevar;    //invalid use of ‘A::t’
      f&lt;a::t&gt;();      //‘a’ cannot appear in a constant-expression
      a::t somevar;   //‘a’ is not a class, namespace, or enumeration
  }
  </code></pre>
  
  <p>EDIT:
  Guys, please read the question and test your code before posting. The point here is NOT to use <code>A::t</code> but "invoke" <code>t</code> through an <em>instance</em> of <code>A</code>, like you can do with static methods.</p>