title: Invalid template argument
body: <p>I'm struggling with templates ! Consider the following code:</p>
  
  <pre><code>template &lt;typename... Ts&gt; struct Sequence {};
  
  template&lt;unsigned N&gt; struct B {
    template&lt;unsigned P&gt; struct C {
      typedef int type;
    };
  };
  </code></pre>
  
  <p>Then this is perfectly correct:</p>
  
  <pre><code>template&lt;unsigned... Is&gt;
  struct Loop2 {
    typedef Sequence&lt; typename B&lt;5&gt;::C&lt;Is&gt;::type... &gt; type;
  };
  
  Loop2&lt;3,1&gt; l;
  </code></pre>
  
  <p>Therefore I can't understand why this templated version:</p>
  
  <pre><code>template&lt;unsigned N, unsigned... Is&gt;
  struct Loop3 {
    typedef Sequence&lt; typename B&lt;N&gt;::C&lt;Is&gt;::type... &gt; type;
  };
  </code></pre>
  
  <p>isn't accepted by the compiler. It raise the following error:</p>
  
  <pre><code>essai.cpp:29:51: error: template argument 1 is invalid
     typedef Sequence&lt; typename B&lt;N&gt;::C&lt;Is&gt;::type... &gt; type;
  </code></pre>
  
  <p>For the information I got this with</p>
  
  <pre><code>g++ (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
  </code></pre>
  
  <p>Thanks for any help !</p>
  
  <p>By the way: any suggestion for a better title is welcome !</p>