title: C++ Class Typedef Struct does not name a type
body: <p>I'm trying to make use of typedef structs inside of my C++ program. I started writing the following code until I received an error when trying to add a method to my class that returns a template typedef struct pointer.</p>
  
  <p>StructSource.h</p>
  
  <pre><code>template &lt;typename T&gt;
  class StructSource {
  public:
      struct TestStruct{
          T value;
      };
  };
  </code></pre>
  
  <p>User.h</p>
  
  <pre><code>#include "StructSource.h"
  
  class User {
      public:
          typedef StructSource&lt;int&gt;::TestStruct IntStruct;
  
          IntStruct *getIntStruct();
  
  };
  </code></pre>
  
  <p>User.cpp</p>
  
  <pre><code>#include "User.h"
  
  IntStruct *User::getIntStruct() {
      return 0;
  }
  </code></pre>
  
  <p>This gives the following error when compiling with GCC.</p>
  
  <blockquote>
    <p>User.cpp:3:1: error: ‘IntStruct’ does not name a type</p>
  </blockquote>
  
  <p>I'm at a loss to explain why this is the case. What type information am I missing?</p>