title: How can I get a specialized template to use the unspecialized version of a member function?
body: <p>Consider the following code:</p>
  
  <pre><code>template &lt;int dim&gt;
  struct vec
  {
      vec normalize();
  };
  
  
  template &lt;&gt;
  struct vec&lt;3&gt;
  {
      vec cross_product(const vec&amp; second);
      vec normalize();
  };
  
  template &lt;int dim&gt;
  vec&lt;dim&gt; vec&lt;dim&gt;::normalize()
  {
      // code to normalize vector here
      return *this;
  }
  
  int main()
  {
      vec&lt;3&gt; direction;
      direction.normalize();
  }
  </code></pre>
  
  <p>Compiling this code produces the following error:</p>
  
  <blockquote>
    <p>1>main.obj : error LNK2019: unresolved external symbol "public: struct vec&lt;3> __thiscall vec&lt;3>::normalize(void)" (?normalize@?$vec@$02@@QAE?AU1@XZ) referenced in function _main</p>
  </blockquote>