diff options
-rw-r--r-- | compat/qhash.hpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/compat/qhash.hpp b/compat/qhash.hpp index c2be4fc5..72c5e7cd 100644 --- a/compat/qhash.hpp +++ b/compat/qhash.hpp @@ -1,14 +1,17 @@ #pragma once +#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) +#include <QHash> #include <QString> -#include <QHashFunctions> +#include <functional> namespace std { -template<> struct hash<QString> -{ - unsigned operator()(const QString& value) const - { - return qHash(value); + template<> struct hash<QString> { + size_t operator()(const QString& s) const noexcept { + return (size_t) qHash(s); } -}; + }; } +#else +#include <QHashFunctions> +#endif
\ No newline at end of file |