title: Nested templates with dependent scope
body: <p>What is dependent scope and what is the meaning of typename in the context of the following error? </p>
  
  <pre><code>$ make
  g++ -std=gnu++0x main.cpp
  main.cpp:18:10: error: need 'typename' before 'ptrModel&lt;std::vector&lt;Data&gt; &gt;::Type' because 'ptrModel&lt;std::vector&lt;Data&gt; &gt;' is a dependent scope
  make: *** [all] Error 1
  
  
  /*
   * main.cpp
   */
  
  #include &lt;vector&gt;
  #include &lt;memory&gt;
  
  template&lt;typename T&gt;
  struct ptrModel
  {
   typedef std::unique_ptr&lt;T&gt; Type;
  };
  
  
  template&lt;typename Data&gt;
  struct ptrType
  {
   typedef ptrModel&lt; std::vector&lt;Data&gt; &gt;::Type Type;
  };
  
  int main()
  {
   return 0;
  }
  </code></pre>