title: Use typedefinition from other class in constructor of templated class
body: <p>I am trying to make a class where the constructor takes in a parameter of a type corresponding to a typedefinition defined in the templated class.
  Please see the following illustrational snippet which does not compile.</p>
  
  <pre><code>class A
  {
      typedef enum test_t {
          a1,
          a2,
          a3
      } test_t;
  };
  
  template &lt;class T&gt;
  class B
  {
      B(T::test_t obj);
  };
  
  template &lt;class T&gt;
  B&lt;T&gt;::B(T::test_t obj)
  {
  
  }
  
  // Explicit definition to let compiler know a template instantiation
  template class B&lt;A&gt;;
  </code></pre>
  
  <p>When compiling this code I get the following errors:</p>
  
  <blockquote>
    <p>TemplatedClassTest.cpp:13:14: error: expected ‘)’ before ‘obj’</p>
    
    <p>TemplatedClassTest.cpp:17:8: error: expected constructor, destructor, or type conversion before ‘(’ token</p>
  </blockquote>