diff options
Diffstat (limited to 'src/corelib/tools/qhashfunctions.h')
-rw-r--r-- | src/corelib/tools/qhashfunctions.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index 018c317834..835fed9589 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -175,6 +175,10 @@ Q_DECL_CONST_FUNCTION constexpr inline size_t qHash(QKeyCombination key, size_t { return qHash(key.toCombined(), seed); } Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = 0) noexcept; +template <typename Enum> +Q_DECL_CONST_FUNCTION constexpr inline size_t qHash(QFlags<Enum> flags, size_t seed = 0) noexcept +{ return qHash(flags.toInt(), seed); } + template <typename T, std::enable_if_t<QHashPrivate::HasQHashSingleArgOverload<T>, bool> = true> size_t qHash(const T &t, size_t seed) noexcept(noexcept(qHash(t))) { return qHash(t) ^ seed; } |