2 ms·
> C++ doesn't check that the key type for an hashmap is hashable I thought it was possible to do something like this? (disclaimer: I don't use c++) class Hash
by earenndil 9y ago
> C++ doesn't check that the key type for an hashmap is hashable
I thought it was possible to do something like this? (disclaimer: I don't use c++)
class Hashable { abstract char *hash() = 0; }
template<typename T: Hashable, typename U>
class Hashmap {
vector<U> buckets;
// etc.
}