#include struct MyStruct; QHash hash; 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() { return hash.value(MyStruct()); }