Template alias and specialization
<p>Assuming we have</p>

<pre><code>template&lt;typename T&gt; 
struct Foo
{
};

template&lt;typename T&gt; 
struct Bar
{
};

template&lt; template&lt;typename T&gt; class C &gt;
struct Pack
{
    template&lt;typename T&gt;
    using Container = C&lt;T&gt;;
};
</code></pre>

<p>Are <code>Foo</code> and <code>Pack&lt;Foo&gt;::Container</code> supposed to be treated as the same thing if we have a specialization for <code>Foo</code>? That is:</p>

<pre><code>template&lt; template&lt;typename T&gt; class C &gt;
struct IsFoo : std::false_type
{
};

template&lt;&gt;
struct IsFoo&lt;Foo&gt; : std::true_type
{
};

static_assert( IsFoo&lt;Foo&gt;::value,                             "Only foos!" );
static_assert( IsFoo&lt; Pack&lt;Foo&gt;::Container &gt;::value,          "Only foos!" ); // ???
static_assert( IsFoo&lt; Pack&lt;Bar&gt;::Container &gt;::value == false, "Not a foo!" );
</code></pre>

<p>Is that second assertion correct? What is the expected behavior? Heck, is what I am trying to do even valid?</p>

<p>I tested it on three compilers and I got different results. It seems that for
MSVC and CLang, <code>Foo</code> and <code>Pack&lt;Foo&gt;::Container</code> are not the same thing, but <a href="http://coliru.stacked-crooked.com/a/622df10803be63cd">GCC disagrees</a>, which is cool, because that is exactly what I wanted.</p>

<p>So, who is right? </p>

<p>PS: I am not sure if I am using the correct terminology on the title, nor inside the body of my question. Suggestions and corrections are more than welcome.</p>