I have a class using a hash table. The constructor of the hash table takes as parameters the number of buckets, a pointer to a hash function, and a pointer to a comparison function. My problem is that the size of the hashtable is not necessarily constant, so I can't define a function that takes into account the size of the hash table (i.e. my hash function would just mod the key by the size of the hashtable). Is there a way around this (e.g. creating a function that returns a function)?