mirror of https://github.com/qt/qtbase.git
QVarLengthArray: give the default Prealloc a name
... and use that in QVarLengthFlatMap's definition in lieu of a magic constant. Amendsd4611ba3a5
. Pick-to: 6.2 Change-Id: I369f31b643789075ef6c14669b8b794ed0b3bbb1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commitc30195a95e
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commitaea4e9788a
) (cherry picked from commit823a9677b4
)
This commit is contained in:
parent
08da29e0dc
commit
cbf90b6304
|
@ -25,7 +25,8 @@ using QPair = std::pair<T1, T2>;
|
|||
template <typename T> class QQueue;
|
||||
template <typename T> class QSet;
|
||||
template <typename T> class QStack;
|
||||
template <typename T, qsizetype Prealloc = 256> class QVarLengthArray;
|
||||
constexpr qsizetype QVarLengthArrayDefaultPrealloc = 256;
|
||||
template <typename T, qsizetype Prealloc = QVarLengthArrayDefaultPrealloc> class QVarLengthArray;
|
||||
template <typename T> class QList;
|
||||
class QString;
|
||||
#ifndef Q_QDOC
|
||||
|
|
|
@ -1099,7 +1099,9 @@ private:
|
|||
containers c;
|
||||
};
|
||||
|
||||
template<class Key, class T, qsizetype N = 256, class Compare = std::less<Key>>
|
||||
template <class Key, class T,
|
||||
qsizetype N = QVarLengthArrayDefaultPrealloc,
|
||||
class Compare = std::less<Key>>
|
||||
using QVarLengthFlatMap = QFlatMap<Key, T, Compare, QVarLengthArray<Key, N>, QVarLengthArray<T, N>>;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
Loading…
Reference in New Issue