Templated Fixed + Variable-Sized Class
<p>Let's say I have several container classes like these:</p>

<pre><code>template&lt;typename T&gt; class Container
{
    /* ... */
};

template&lt;typename T, size_t&gt; class Array : public Container&lt;T&gt;
{
    /* Fixed-sized Container */
};

template&lt;typename T&gt; class Vector : public Container&lt;T&gt;
{
    /* Variable-sized Container */
};
</code></pre>

<p>And I have a class which accepts one of these as a template parameter:</p>

<pre><code>template&lt;typename T, template&lt;typename&gt; class U, size_t M&gt; class Polygon
{
    U&lt;T&gt; Vertices; // Problem, what if user passes Array (it needs 2 parameters)
    U&lt;T, M&gt; Vertices; // Problem, what if the user wants to use a variable-sized container (it needs only 1 parameter)
};
</code></pre>

<p>My question is, can I somehow (probably through tricky template parameter magic) make the consuming class accept any type of container (fixed or variable-sized, even with differing template signatures)?</p>

<p>The only guarantees about the template signatures are, if it is a Fixed-sized container it will have 2 parameters <code>&lt;Type, Size&gt;</code> and one if it is a Variable-sized container <code>&lt;Type&gt;</code></p>