Template argument for non-type parameter must be an expression
<p>Why is the following code wrong?</p>

<pre><code>template &lt;typename T, int N&gt;
struct Vector {
    T data[N];
};

struct Dynamic {
};

template &lt;typename T&gt;
struct Vector&lt;T, Dynamic&gt; {
    T* data;
};
</code></pre>

<p>I tried to instantiate the code with <code>Vector&lt;int, Dynamic&gt; obj;</code> and it didn't work</p>

<blockquote>
  <p>error: template argument for non-type template parameter must be an expression</p>
</blockquote>

<p>Why? I'm passing a type and I thought that was a valid template specialization.</p>

<p>How can I use two templates and having one that requests N and one that doesn't if marked with <code>Dynamic</code> ?</p>