From 4a97e3b98a40e6d35a4e63e171319ed02961a0cc Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 17 Mar 2017 00:07:57 +0300 Subject: QMap, QHash: make key_iterator satisfy the DefaultConstructible concept Change-Id: Ifc3f481ddb902b26c217516412c93a4a39a32b1c Reviewed-by: Marc Mutz --- tests/auto/corelib/tools/qhash/tst_qhash.cpp | 4 ++++ tests/auto/corelib/tools/qmap/tst_qmap.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 0b864e71d4..0c5f1a7afb 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -1053,6 +1053,10 @@ void tst_QHash::keyIterator() QCOMPARE(*(--key_it), (--it).key()); QCOMPARE(std::count(hash.keyBegin(), hash.keyEnd(), 99), 1); + + // DefaultConstructible test + typedef QHash::key_iterator keyIterator; + Q_STATIC_ASSERT(std::is_default_constructible::value); } void tst_QHash::rehash_isnt_quadratic() diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index 8aa7a3e518..f42ffc0471 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -857,6 +857,10 @@ void tst_QMap::keyIterator() QCOMPARE(*(--key_it), (--it).key()); QCOMPARE(std::count(map.keyBegin(), map.keyEnd(), 99), 1); + + // DefaultConstructible test + typedef QMap::key_iterator keyIterator; + Q_STATIC_ASSERT(std::is_default_constructible::value); } void tst_QMap::keys_values_uniqueKeys() -- cgit v1.2.3