diff options
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 01fc63b677..ba65ae7ef2 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -44,6 +44,7 @@ #include <QtCore/qglobal.h> #include <QtCore/qalgorithms.h> #include <QtCore/qcontainertools_impl.h> +#include <QtCore/qhashfunctions.h> #include <algorithm> #include <initializer_list> @@ -60,7 +61,9 @@ template<class T, int Prealloc> class QVarLengthArray { public: - inline explicit QVarLengthArray(int size = 0); + QVarLengthArray() : QVarLengthArray(0) {} + + inline explicit QVarLengthArray(int size); inline QVarLengthArray(const QVarLengthArray<T, Prealloc> &other) : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array)) @@ -599,6 +602,13 @@ inline bool operator>=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengt return !(lhs < rhs); } +template <typename T, int Prealloc> +uint qHash(const QVarLengthArray<T, Prealloc> &key, uint seed = 0) + noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed))) +{ + return qHashRange(key.cbegin(), key.cend(), seed); +} + QT_END_NAMESPACE #endif // QVARLENGTHARRAY_H |