title: Inserting an object of struct into a hash table C++
body: <p>I'm currently working on a project involving hash tables. I've read in a text file into a vector of Symbol structs and I now have to insert these structs (objects, really) into a hash table. I was given a specific insertion function to use, however, I can't seem to get it to work. I've included the insertion function below as well as my Driver.cpp file which contains reading in the file to vector of structs and my attempt at inserting this into the hash table. </p>
  
  <p>I would appreciate any help/feedback has to where I'm going wrong.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;time.h&gt; 
  #include &lt;unistd.h&gt;
  #include "SeparateChaining.h" 
  
  using namespace std;
  
  struct Symbol
  {
      int type;
      string name;
  };
  
  size_t hash(const string &amp; key); //declaration of hashing function
  
  int main()
  {
      /************ VARS ***************/
      string line;
      int line_count;
      int table_size;
      int increment;
  
      /************ Vector of Symbols ***************/
      vector&lt;Symbol&gt; symbols;
  
      /************ HashTable of Symbols ***************/
      HashTable&lt;Symbol&gt; hashtable; //precomputed to have 101 elements --&gt; probably will change this to accomodate table size.
  
      cout &lt;&lt; "Opening file..." &lt;&lt; endl;
      usleep(2000000);
  
      ifstream file;
      file.open("symbols.txt");
  
      if(!file)
      {
          cout &lt;&lt; "System failed to open file.";
      }
      else
      {
          cout &lt;&lt; "File successfully opened" &lt;&lt; endl;
      }
  
      cout &lt;&lt; "Please enter the table size for the Hash Table. (NOTE: It MUST be a prime number.)" &lt;&lt; endl;
      cin &gt;&gt; table_size;
  
      for(Symbol temp; file &gt;&gt; temp.name &gt;&gt; temp.type;)
      {
          symbols.push_back(temp);
          increment++;
      }
      //Just to test and see if its loading it correctly...
      for(int i = 0; i &lt; symbols.size(); i++)
      {
          cout &lt;&lt; symbols[i].name &lt;&lt; endl;
          cout &lt;&lt; symbols[i].type &lt;&lt; endl;
      }
      for(int j = 0; j &lt; symbols.size(); j++)
      {
          hashtable.insert(symbols); // Messing up here !!!!!!!!!!!!!
      }
      //cout &lt;&lt; ::hash("hi") &lt;&lt; endl;
  }
  
  size_t hash( const string &amp; key )
  {
      size_t hashVal = 0;
  
      for( char ch : key )
          hashVal = 37 * hashVal + ch;
  
      return hashVal;
  }
  </code></pre>
  
  <p>Insert function(s) in the SeparateChaining.h:</p>
  
  <pre><code>bool insert( const HashedObj &amp; x )
      {
          auto &amp; whichList = theLists[ myhash( x ) ];
          if( find( begin( whichList ), end( whichList ), x ) != end( whichList) )
              return false;
          whichList.push_back( x );
  
              // Rehash; see Section 5.5
          if( ++currentSize &gt; theLists.size( ) )
              rehash( );
  
          return true;
      }
  
      bool insert( HashedObj &amp;&amp; x )
      {
          auto &amp; whichList = theLists[ myhash( x ) ];      
          if( find( begin( whichList ), end( whichList ), x ) != end( whichList ) )
              return false;
          whichList.push_back( std::move( x ) );
  
              // Rehash; see Section 5.5
          if( ++currentSize &gt; theLists.size( ) )
              rehash( );
  
          return true;
      }
  </code></pre>
  
  <p>Errors when done as hashtable.insert(symbols):</p>
  
  <pre><code>    Driver.cpp: In function 'int main()':
      Driver.cpp:65:27: error: no matching function for call to 'HashTable&lt;Symbol&gt;::insert(std::vector&lt;Symbol&gt;&amp;)'
      Driver.cpp:65:27: note: candidates are:
      In file included from Driver.cpp:8:0:
      SeparateChaining.h:44:10: note: bool HashTable&lt;HashedObj&gt;::insert(const HashedObj&amp;) [with HashedObj = Symbol]
      SeparateChaining.h:44:10: note:   no known conversion for argument 1 from 'std::vector&lt;Symbol&gt;' to 'const Symbol&amp;'
      SeparateChaining.h:58:10: note: bool HashTable&lt;HashedObj&gt;::insert(HashedObj&amp;&amp;) [with HashedObj = Symbol]
      SeparateChaining.h:58:10: note:   no known conversion for argument 1 from 'std::vector&lt;Symbol&gt;' to 'Symbol&amp;&amp;'
  </code></pre>
  
  <p>Errors when done as hashtable.insert(symbols[j]) after incrementing through the vector:</p>
  
  <pre><code>In file included from /opt/local/include/gcc47/c++/bits/basic_string.h:3032:0,
                               from /opt/local/include/gcc47/c++/string:54,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/functional_hash.h: In instantiation of 'struct std::hash&lt;Symbol&gt;':
              SeparateChaining.h:107:32:   required from 'size_t HashTable&lt;HashedObj&gt;::myhash(const HashedObj&amp;) const [with HashedObj = Symbol; size_t = long unsigned int]'
              SeparateChaining.h:46:50:   required from 'bool HashTable&lt;HashedObj&gt;::insert(const HashedObj&amp;) [with HashedObj = Symbol]'
              Driver.cpp:65:30:   required from here
              /opt/local/include/gcc47/c++/bits/functional_hash.h:60:7: error: static assertion failed: std::hash is not specialized for this type
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h: In instantiation of '_InputIterator std::__find(_InputIterator, _InputIterator, const _Tp&amp;, std::input_iterator_tag) [with _InputIterator = std::_List_iterator&lt;Symbol&gt;; _Tp = Symbol]':
              /opt/local/include/gcc47/c++/bits/stl_algo.h:4466:45:   required from '_IIter std::find(_IIter, _IIter, const _Tp&amp;) [with _IIter = std::_List_iterator&lt;Symbol&gt;; _Tp = Symbol]'
              SeparateChaining.h:47:9:   required from 'bool HashTable&lt;HashedObj&gt;::insert(const HashedObj&amp;) [with HashedObj = Symbol]'
              Driver.cpp:65:30:   required from here
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: error: no match for 'operator==' in '__first.std::_List_iterator&lt;_Tp&gt;::operator*&lt;Symbol&gt;() == __val'
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note: candidates are:
              In file included from /opt/local/include/gcc47/c++/bits/stl_algo.h:68:0,
                               from /opt/local/include/gcc47/c++/algorithm:63,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/functional:2382:5: note: template&lt;class _Res, class ... _Args&gt; bool std::operator==(std::nullptr_t, const std::function&lt;_Res(_ArgTypes ...)&gt;&amp;)
              /opt/local/include/gcc47/c++/functional:2382:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   cannot convert '__first.std::_List_iterator&lt;_Tp&gt;::operator*&lt;Symbol&gt;()' (type 'Symbol') to type 'std::nullptr_t'
              In file included from /opt/local/include/gcc47/c++/bits/stl_algo.h:68:0,
                               from /opt/local/include/gcc47/c++/algorithm:63,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/functional:2376:5: note: template&lt;class _Res, class ... _Args&gt; bool std::operator==(const std::function&lt;_Res(_ArgTypes ...)&gt;&amp;, std::nullptr_t)
              /opt/local/include/gcc47/c++/functional:2376:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::function&lt;_Res(_ArgTypes ...)&gt;'
              In file included from /opt/local/include/gcc47/c++/functional:56:0,
                               from /opt/local/include/gcc47/c++/bits/stl_algo.h:68,
                               from /opt/local/include/gcc47/c++/algorithm:63,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/tuple:797:5: note: template&lt;class ... _TElements, class ... _UElements&gt; bool std::operator==(const std::tuple&lt;_Elements ...&gt;&amp;, const std::tuple&lt;_Elements ...&gt;&amp;)
              /opt/local/include/gcc47/c++/tuple:797:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::tuple&lt;_Elements ...&gt;'
              In file included from /opt/local/include/gcc47/c++/random:51:0,
                               from /opt/local/include/gcc47/c++/bits/stl_algo.h:67,
                               from /opt/local/include/gcc47/c++/algorithm:63,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/random.tcc:1713:5: note: template&lt;class _RealType1&gt; bool std::operator==(const std::normal_distribution&lt;_RealType&gt;&amp;, const std::normal_distribution&lt;_RealType&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/random.tcc:1713:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::normal_distribution&lt;_RealType&gt;'
              In file included from /opt/local/include/gcc47/c++/list:64:0,
                               from SeparateChaining.h:6,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_list.h:1574:5: note: template&lt;class _Tp, class _Alloc&gt; bool std::operator==(const std::list&lt;_Tp, _Alloc&gt;&amp;, const std::list&lt;_Tp, _Alloc&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_list.h:1574:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::list&lt;_Tp, _Alloc&gt;'
              In file included from /opt/local/include/gcc47/c++/list:64:0,
                               from SeparateChaining.h:6,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_list.h:277:5: note: template&lt;class _Val&gt; bool std::operator==(const std::_List_iterator&lt;_Tp&gt;&amp;, const std::_List_const_iterator&lt;_Val&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_list.h:277:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::_List_iterator&lt;_Tp&gt;'
              In file included from /opt/local/include/gcc47/c++/vector:65:0,
                               from Driver.cpp:4:
              /opt/local/include/gcc47/c++/bits/stl_vector.h:1370:5: note: template&lt;class _Tp, class _Alloc&gt; bool std::operator==(const std::vector&lt;_Tp, _Alloc&gt;&amp;, const std::vector&lt;_Tp, _Alloc&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_vector.h:1370:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::vector&lt;_Tp, _Alloc&gt;'
              In file included from /opt/local/include/gcc47/c++/bits/locale_facets.h:50:0,
                               from /opt/local/include/gcc47/c++/bits/basic_ios.h:39,
                               from /opt/local/include/gcc47/c++/ios:45,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/streambuf_iterator.h:206:5: note: template&lt;class _CharT, class _Traits&gt; bool std::operator==(const std::istreambuf_iterator&lt;_CharT, _Traits&gt;&amp;, const std::istreambuf_iterator&lt;_CharT, _Traits&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/streambuf_iterator.h:206:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::istreambuf_iterator&lt;_CharT, _Traits&gt;'
              In file included from /opt/local/include/gcc47/c++/string:54:0,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/basic_string.h:2516:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator==(const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const _CharT*)
              /opt/local/include/gcc47/c++/bits/basic_string.h:2516:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;'
              In file included from /opt/local/include/gcc47/c++/string:54:0,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/basic_string.h:2504:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator==(const _CharT*, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/basic_string.h:2504:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   mismatched types 'const _CharT*' and 'Symbol'
              In file included from /opt/local/include/gcc47/c++/string:54:0,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/basic_string.h:2490:5: note: template&lt;class _CharT&gt; typename __gnu_cxx::__enable_if&lt;std::__is_char&lt;_Tp&gt;::__value, bool&gt;::__type std::operator==(const std::basic_string&lt;_CharT&gt;&amp;, const std::basic_string&lt;_CharT&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/basic_string.h:2490:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::basic_string&lt;_CharT&gt;'
              In file included from /opt/local/include/gcc47/c++/string:54:0,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/basic_string.h:2483:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator==(const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/basic_string.h:2483:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::basic_string&lt;_CharT, _Traits, _Alloc&gt;'
              In file included from /opt/local/include/gcc47/c++/string:43:0,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/allocator.h:124:5: note: template&lt;class _Tp&gt; bool std::operator==(const std::allocator&lt;_CharT&gt;&amp;, const std::allocator&lt;_CharT&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/allocator.h:124:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::allocator&lt;_CharT&gt;'
              In file included from /opt/local/include/gcc47/c++/string:43:0,
                               from /opt/local/include/gcc47/c++/bits/locale_classes.h:42,
                               from /opt/local/include/gcc47/c++/bits/ios_base.h:43,
                               from /opt/local/include/gcc47/c++/ios:43,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/allocator.h:119:5: note: template&lt;class _T1, class _T2&gt; bool std::operator==(const std::allocator&lt;_CharT&gt;&amp;, const std::allocator&lt;_T2&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/allocator.h:119:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::allocator&lt;_CharT&gt;'
              In file included from /opt/local/include/gcc47/c++/bits/stl_algobase.h:68:0,
                               from /opt/local/include/gcc47/c++/bits/char_traits.h:41,
                               from /opt/local/include/gcc47/c++/ios:41,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:1039:5: note: template&lt;class _Iterator&gt; bool std::operator==(const std::move_iterator&lt;_Iterator&gt;&amp;, const std::move_iterator&lt;_Iterator&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:1039:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::move_iterator&lt;_Iterator&gt;'
              In file included from /opt/local/include/gcc47/c++/bits/stl_algobase.h:68:0,
                               from /opt/local/include/gcc47/c++/bits/char_traits.h:41,
                               from /opt/local/include/gcc47/c++/ios:41,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:1033:5: note: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator==(const std::move_iterator&lt;_Iterator&gt;&amp;, const std::move_iterator&lt;_IteratorR&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:1033:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::move_iterator&lt;_Iterator&gt;'
              In file included from /opt/local/include/gcc47/c++/bits/stl_algobase.h:68:0,
                               from /opt/local/include/gcc47/c++/bits/char_traits.h:41,
                               from /opt/local/include/gcc47/c++/ios:41,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:343:5: note: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator==(const std::reverse_iterator&lt;_Iterator&gt;&amp;, const std::reverse_iterator&lt;_IteratorR&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:343:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::reverse_iterator&lt;_Iterator&gt;'
              In file included from /opt/local/include/gcc47/c++/bits/stl_algobase.h:68:0,
                               from /opt/local/include/gcc47/c++/bits/char_traits.h:41,
                               from /opt/local/include/gcc47/c++/ios:41,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:293:5: note: template&lt;class _Iterator&gt; bool std::operator==(const std::reverse_iterator&lt;_Iterator&gt;&amp;, const std::reverse_iterator&lt;_Iterator&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_iterator.h:293:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::reverse_iterator&lt;_Iterator&gt;'
              In file included from /opt/local/include/gcc47/c++/bits/stl_algobase.h:65:0,
                               from /opt/local/include/gcc47/c++/bits/char_traits.h:41,
                               from /opt/local/include/gcc47/c++/ios:41,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/stl_pair.h:206:5: note: template&lt;class _T1, class _T2&gt; constexpr bool std::operator==(const std::pair&lt;_T1, _T2&gt;&amp;, const std::pair&lt;_T1, _T2&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/stl_pair.h:206:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::pair&lt;_T1, _T2&gt;'
              In file included from /opt/local/include/gcc47/c++/iosfwd:42:0,
                               from /opt/local/include/gcc47/c++/ios:39,
                               from /opt/local/include/gcc47/c++/ostream:40,
                               from /opt/local/include/gcc47/c++/iostream:40,
                               from Driver.cpp:1:
              /opt/local/include/gcc47/c++/bits/postypes.h:218:5: note: template&lt;class _StateT&gt; bool std::operator==(const std::fpos&lt;_StateT&gt;&amp;, const std::fpos&lt;_StateT&gt;&amp;)
              /opt/local/include/gcc47/c++/bits/postypes.h:218:5: note:   template argument deduction/substitution failed:
              In file included from /opt/local/include/gcc47/c++/algorithm:63:0,
                               from SeparateChaining.h:8,
                               from Driver.cpp:8:
              /opt/local/include/gcc47/c++/bits/stl_algo.h:135:7: note:   'Symbol' is not derived from 'const std::fpos&lt;_StateT&gt;'
  </code></pre>