title: C++ template class compile error
body: <p>I'm implementing a HashTable myself and found the following error:</p>
  
  <pre><code> 19 template &lt;class key, class value&gt;
   20 class HashEntry { ... }
  
   60 template &lt;class key, class value&gt;
   61 class HashTable
   62 {
   63 
   64 private:
   65     size_t _tableSize;
   66     HashEntry&lt;key, value&gt;** _table;
   67 
   68 public:
   69 
   70     HashTable(size_t s)
   71     {
   72         _tableSize = s;
   73         _table = (HashEntry&lt;key, value&gt;**) smalloc(s * sizeof(HashTable&lt;key, value&gt;*));
   74     }
   75 
   76     void addEntry(HashEntry&lt;key, value&gt;(key k, value v))  &lt;---
   77     {
   78 
   79     }
   80 
   ...
   91 };
  
   93 int main ()
   94 {
   95     HashTable&lt;int, string&gt; t(100);
   96     t.addEntry(HashEntry&lt;int, string&gt;(1, string("a")));    &lt;---
  
  HASH_chaining.cc:96: error: no matching function for call to ‘HashTable&lt;int, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;::addEntry(HashEntry&lt;int, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;)’
  HASH_chaining.cc:76: note: candidates are: void HashTable&lt;key, value&gt;::addEntry(HashEntry&lt;key, value&gt; (*)(key, value)) [with key = int, value = std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;]
  </code></pre>
  
  <p>At glance, I could't find anything wrong with it. I think it has to do with the way I define the addEntry interface though.</p>
  
  <p>Thanks.</p>