Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.1
-
None
Description
The qHash of QHash table doesn't compile on linux under gcc (version 10 or any modern)
e.g.: for QHash<int, int> a;
qHash(a) fails to compile.
The problem is following:
In qhash.h (line 1445) the hash commutative combiner is called with std :: pair<const Key&, const T&>. In example above it's std :: pair<const int&, const int&>.
In qhashfunctions.h (line 139 - 140) QHashCombineCommutative::operator() calls qHash with the std :: pair<const Key&, const T&>. However qHash for std :: pair is defined AFTER on line 167.
So that it conforms to C++ standard this must be defined (or at least declared) BEFORE.
Fix is to move this above QHashCombineCommutative.