diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index e6ff615b03..07add066af 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -193,6 +193,10 @@ public: iterator erase(const_iterator begin, const_iterator end); iterator erase(const_iterator pos) { return erase(pos, pos + 1); } + size_t hash(size_t seed) const noexcept(QtPrivate::QNothrowHashable_v) + { + return qHashRange(begin(), end(), seed); + } protected: template reference emplace_back_impl(qsizetype prealloc, void *array, Args&&...args) @@ -926,9 +930,9 @@ bool operator>=(const QVarLengthArray &l, const QVarLengthArray size_t qHash(const QVarLengthArray &key, size_t seed = 0) - noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed))) + noexcept(QtPrivate::QNothrowHashable_v) { - return qHashRange(key.cbegin(), key.cend(), seed); + return key.hash(seed); } template