title: Confused implementing a rehash() function in C++
body: <p>My goal is to implement a rehash() method for a hash table I am writing in a C++ template class. However, I am confused what exactly I can hash on since this method only knows the type as a generic. As far as I know, this differs from Java generics</p>
  
  <p>My understanding of java...
  In Java, since every object inherits the hashCode() method, we can override this method. If writing a generic hash table in java, then during the rehash(), the hashCode() method can simply be called to return a value. That can be modded by tableSize. Painless</p>
  
  <p>Back to C++...
  Since I do not believe I can simply call a hashCode() method on my C++ generics nor access a generic type's data members, I don't know what I could rehash on.</p>
  
  <p>Is it possible for my generic type in C++ to inherit an abstract class somewhow so I can force a virtual hashcode()=0 method?
  Or do the hash functions in template classes rely some other kind of non-datamember hashing?</p>
  
  <p>Tried to be as clear as possible. Thanks to anyone that can point me in the right direction or offer some guidance.</p>