From d4611ba3a5b46ee790e6c790ef6c3d771d3507ee Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 9 Jan 2022 10:15:21 +0100 Subject: [PATCH] QFlatMap: add an alias for using QVarLengthArrays ... in an attempt to foster the use of this data structure by making it less onerous to spell. Pick-to: 6.3 6.2 Change-Id: Ib9d17029c75278edde6ba90f65f68af179a6d230 Reviewed-by: Joerg Bornemann Reviewed-by: Lars Knoll --- src/corelib/tools/qflatmap_p.h | 3 +++ tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qflatmap_p.h b/src/corelib/tools/qflatmap_p.h index d7f8ff48cb8..3b847fc63ac 100644 --- a/src/corelib/tools/qflatmap_p.h +++ b/src/corelib/tools/qflatmap_p.h @@ -993,6 +993,9 @@ private: containers c; }; +template> +using QVarLengthFlatMap = QFlatMap, QVarLengthArray>; + QT_END_NAMESPACE #endif // QFLATMAP_P_H diff --git a/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp b/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp index af616f0a4cb..1ba060cc918 100644 --- a/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp +++ b/tests/auto/corelib/tools/qflatmap/tst_qflatmap.cpp @@ -558,8 +558,7 @@ void tst_QFlatMap::viewIterators() void tst_QFlatMap::varLengthArray() { - using Map = QFlatMap, - QVarLengthArray, QVarLengthArray>; + using Map = QVarLengthFlatMap; Map m{ { 2, "twee" } }; m.insert(1, "een"); m.remove(1);