title: Templated class whose argument must be another templated class
body: <p>Well, this is what I'm trying to achieve. I have a struct like this:</p>
  
  <pre><code>template&lt;typename...Ts&gt; struct s
  {
      template&lt;int...Is&gt; struct r
      {
          // whatever
      };
  };
  </code></pre>
  
  <p>Now I'd like to write one more templated structure:</p>
  
  <pre><code>template&lt;typename r&gt; struct q
  {
      //
  };
  </code></pre>
  
  <p>The template should accept specialisations of <code>struct r</code> and I'd like to have access to template arguments of this instantiation.</p>
  
  <p>To make myself more clear: I'd like to be able to write something like this:</p>
  
  <pre><code>using some_specialisation_of_q = q&lt; s&lt;T1,T2,T3&gt;::r&lt;5,6,7&gt; &gt;;
  some_specialisation_of_q varname;
  </code></pre>
  
  <p>AND I'd like to be able to have access to <code>T1,T2,T3</code>, <code>5,6,7</code> (or any other template arguments passed to specialize <code>s</code> and <code>r</code>) in the definition of <code>q</code>.</p>
  
  <p>My first attempt was something like that:</p>
  
  <pre><code>template&lt;template&lt;typename...Ts&gt; template&lt;int...Is&gt; typename R, typename= typename std::enable_if&lt;std::is_same&lt;R, s&lt;Ts...&gt;::r&lt;Is...&gt;&gt;::value&gt;::type&gt;
  struct q
  {
      //
  }
  </code></pre>
  
  <p>But unfortunately this produces compiler errors.</p>
  
  <p>How can this be achieved?</p>