Defining member function of explicitly specialized class outside of the class definition
<p>I'm seeing an error related to templates (compiler is Visual Studio 2012) that I don't understand.  Here's the code, boiled down to the essentials:</p>

<pre><code>// Templated class - generic 
template &lt;typename T&gt;
class Test
{
    public:
        void WorksFine() {} // Comiples and works as expected at runtime
        void Problem();     
};

// Templated class - expicit specialization for T = int.
template &lt;&gt;
class Test&lt;int&gt;
{
        public:
            void WorksFine() {} // Comiples and works as expected at runtime
            void Problem();
};

// The definition below compiles and works fine at runtime.
template&lt;typename T&gt; void Test&lt;T&gt;::Problem() {}


// The definition below gives error C2910.
template&lt;&gt; void Test&lt;int&gt;::Problem() {printf("In Test::Problem(int instantiation)\n");}
</code></pre>

<p>For the WorksFine method, the function definition is <i>inside</i> the explicitly specialized class definition, and everything is fine.  But for the Problem method, when I define the method outside the explicitly specialized class definition, I get error C2910</p>

<p>Why is this?  Error C2910 indicates that the problem is that Test::Problem() is already defined.  But it is <i>not</i> defined inside the class...there is no function definition only a declaration.</p>

<p>It seems pretty lame to be able to do something or not depending on where you choose to put the function definition, which I always though was more of a style/syntax decision, not a functionality/semantics decision.  Am I missing something?</p>
