title: How to perform partial template specialization with a parameter pack and non-type template value?
body: <p>While trying to <a href="https://stackoverflow.com/questions/60434033/how-do-i-expand-a-compile-time-stdarray-into-a-parameter-pack">use a compile time std::array in a variadic template</a>, I wrote this partial template specialization:  </p>
  
  <pre class="lang-cpp prettyprint-override"><code>template &lt;typename array_wrapper&gt; struct Test1;
  template &lt;std::size_t... A&gt; struct Test1&lt;any_type&lt;std::array&lt;std::size_t, sizeof...(A)&gt;{A...}&gt;&gt; {}; //(2)
  </code></pre>
  
  <p>which leads to a compilation error <code>&lt;Expression&gt; has incomplete type and cannot be defined</code> for my attempts to partial template specialization for <code>Test1</code> and <code>Test2</code> when I am trying to use it; hence -- as I understand it -- the usage (3) does not match the definition (2):</p>
  
  <pre><code>int main() {
    Test1&lt;any_type&lt;std::array&lt;std::size_t, 2&gt;{1, 2}&gt;&gt; a; // (3)
  }
  </code></pre>
  
  <p>I don't understand why this is the case though. When experimenting with the example, I realize that this happens when I am 'hiding' the content of the parameter pack in my <code>any_type</code> struct:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;array&gt;
  
  template &lt;auto f&gt; struct any_type;
  
  template &lt;typename array_wrapper&gt; struct Test1;
  template &lt;std::size_t... A&gt; struct Test1&lt;any_type&lt;std::array&lt;std::size_t, sizeof...(A)&gt;{A...}&gt;&gt; {};
  
  template &lt;typename array_wrapper&gt; struct Test2;
  template &lt;int... A&gt; struct Test2&lt;any_type&lt;std::get&lt;0&gt;(A...)&gt;&gt; {};
  
  template &lt;typename array_wrapper&gt; struct Test3;
  template &lt;int A&gt; struct Test3&lt;any_type&lt;A&gt;&gt; {};
  
  int main() {
    //Test1&lt;any_type&lt;std::array&lt;std::size_t, 2&gt;{1, 2}&gt;&gt; a;
    //Test2&lt;any_type&lt;1&gt;&gt; b;
    Test3&lt;any_type&lt;1&gt;&gt; ok;
  }
  </code></pre>
  
  <p>Test1 and Test2 fail with the same error, and Test3 works fine. Why does the partial template specialization 'fail' in the frist two cases? As I understand it, the declaration provides the 'interface' in order to use the struct, and the arguments in the specialization are matched to teh arguments which are actually provided. </p>
  
  <p><strong>Code</strong>
  The code can be found <a href="https://wandbox.org/permlink/x9YuYPL3Y2QeWXEE" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>Compile options:</strong>
  I use<code>g++-10.0 (GCC) 10.0.1 20200124 (experimental)</code> and compile via <code>g++ -std=c++2a file.cc</code>, c++2a is required because I use non-type template parameters.</p>