title: template class with STL container member
body: <p>I'm writing a template class that uses a std::multimap as a member, and getting compile errors.</p>
  
  <p>LocTree.h:</p>
  
  <pre><code>#pragma once
  #include &lt;map&gt;
  
  template &lt;class Loc, class T&gt;
  class LocTree
  {
  public :
           typedef std::multimap&lt;typename Loc, typename T&gt; TreeType;
  
          LocTree( void );
          ~LocTree( void ) { };
  private :
          TreeType db;
  };
  </code></pre>
  
  <p>LocTree.cpp:</p>
  
  <pre><code>#include "StdAfx.h"
  #include "LocTree.h"
  
  LocTree&lt; class Loc, class T&gt;::LocTree()
  {
  }
  </code></pre>
  
  <p>The compile error (from VC2005) :</p>
  
  <pre><code>Error     1     error C2079: 'std::pair&lt;_Ty1,_Ty2&gt;::first' uses undefined class 'Loc'     c:\program files (x86)\microsoft visual studio 8\vc\include\utility     53
  Error     2     error C2079: 'std::pair&lt;_Ty1,_Ty2&gt;::second' uses undefined class 'T'     c:\program files (x86)\microsoft visual studio 8\vc\include\utility     54
  </code></pre>
  
  <p>I know I could put the function definitions in the .h but I'm hoping to keep them separate, if it's legal to do so.  How do I fix this (probably newbie) problem?</p>