title: Template specialization of a member function
body: <p>I have to use an explicit specialization for a class member function in (C++ , I am using MS Visual Studio 2008 SP1), but I could not success to compile it. Getting </p>
  
  <blockquote>
    <p>error C2910: 'File::operator &lt;&lt;' : cannot be explicitly specialized</p>
  </blockquote>
  
  <pre><code>class File
  {
     std::ofstream mOutPutFile;
  public:
     template&lt;typename T&gt;
     File&amp; operator&lt;&lt;(T const&amp; data);
  };
  
  
  template&lt;typename T&gt;
  File&amp; File::operator&lt;&lt; (T const&amp; data)
  {
      mOutPutFile &lt;&lt; preprosesor(data);
      return *this;
  }
  
  template&lt; &gt;
  File&amp; File::operator&lt;&lt; &lt;&gt; (std::ofstream&amp; out)
  {
     mOutPutFile &lt;&lt; out;
     return *this;
  }
  </code></pre>