title: c++ template partial specialization member function
body: <p>I'm new to templates so maybe this is a trivial thing but I cannot get it to work. I'm trying to get partial specialization of a class member function. The shortest code would be:</p>
  
  <pre><code>template &lt;typename T, int nValue&gt; class Object{
  private:
      T m_t;
      Object();
  public:
      Object(T t): m_t(t) {}
      T Get() { return m_t; } 
      Object&amp; Deform(){ 
          m_t*=nValue; 
          return *this;
      }
  };
  
  template &lt;typename T&gt;
  Object&lt;T,0&gt;&amp; Object&lt;T,0&gt;::Deform(){
      this-&gt;m_t = -1;
      return *this;
  }
  
  int main(){
      Object&lt;int,7&gt; nObj(1);
      nObj.Deform();
      std::cout&lt;&lt;nObj.Get();
  }
  </code></pre>
  
  <p>I tried with nonmember functions and that's worked fine. What also works fine is full specialization of a member function.</p>
  
  <p>But, whenever I try with partial spec. of a member function I get error of the form: </p>
  
  <pre><code>PartialSpecification_MemberFu.cpp(17): error: template argument
  list must match the parameter list Object&lt;T,0&gt;&amp; Object&lt;T,0&gt;::Deform().
  </code></pre>
  
  <p>Would appreciate any help :-)</p>