QVarLengthArray: add qHash overload
[ChangeLog][QtCore][QVarLengthArray] Added a qHash overload. Change-Id: I771203ae3bb575b49f70e9114287dd2690031b42 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
parent
5e86aa93fc
commit
7eb070b450
|
|
@ -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>
|
||||
|
|
@ -599,6 +600,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
|
||||
|
|
|
|||
|
|
@ -903,3 +903,11 @@
|
|||
\sa indexOf(), lastIndexOf()
|
||||
*/
|
||||
|
||||
/*!
|
||||
template <typename T, int Prealloc> uint qHash(const QVarLengthArray<T, Prealloc> &key, uint seed = 0)
|
||||
\relates QVarLengthArray
|
||||
\since 5.14
|
||||
|
||||
Returns the hash value for \a key, using \a seed to seed the
|
||||
calculation.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue