#include struct MyStruct { int a; MyStruct() : a(0) {} bool operator==(const MyStruct &other) const { return a == other.a; } }; uint qHash(const MyStruct &) { return 0; } int main() { QHash hash; return hash.value(MyStruct()); }