title: How to name a nested template in a templated base class?
body: <p>In the following setup, how can I make it so that I can refer to the name <code>Bar</code> inside the derived class <code>Derived&lt;T&gt;</code>?</p>
  
  <pre><code>template &lt;typename T&gt; struct Foo
  {
      template &lt;typename U&gt; struct Bar { };
  };
  
  template &lt;typename T&gt; struct Derived : Foo&lt;T&gt;
  {
      // what goes here?
  
      Bar&lt;int&gt; x;  // Error: 'Bar' does not name a type
  };
  </code></pre>
  
  <p>I've tried <code>using Foo&lt;T&gt;::Bar;</code>, but that doesn't help. Is there any sort of <code>using</code> declaration that can make the name of a nested base template known to the derived class, so that I can keep the simple de&shy;cla&shy;ration <code>Bar&lt;int&gt; x</code>?</p>
  
  <p>I know that I can say <code>typename Foo&lt;T&gt;::template Bar&lt;int&gt; x;</code>, but I have a lot of those cases and I don't want to burden the code needlessly with so much verbosity. I also have a lot of distinct "<code>int</code>s", so a <code>typedef</code> for each nested-template instance is not feasible, either.</p>
  
  <p>Also, I cannot use GCC 4.7 at this point nor C++11, and would thus like a "traditional" solution without template aliases.</p>