summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/containerapisymmetry
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-111-1/+1
|\ | | | | | | | | | | | | Conflicts: tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp Change-Id: I6b82507bf9a80a374c40393e72f4843f1557de89
| * Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Get rid of QCharRef and QByteRefLars Knoll2019-12-081-2/+0
| | | | | | | | | | | | | | | | | | | | We already detach immediately since change c2d2757bccc68e1b981df059786c2e76f2969530. That basically removes the main purpose of having QChar/ByteRef, and we can just as well get rid of those classes for Qt 6. Change-Id: I8dc566a1948ddc29c0cb8a77ec7310654a7219a4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Get rid of QT_STRICT_ITERATORSLars Knoll2019-11-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | The concept was a nice idea to avoid accidental detach() calls in implicitly shared containers, but it conflicts with a C++11 compatible API for them, with signatures for modifying methods taking a const_iterator as argument and returning an iterator (e.g. iterator erase(const_iterator)). Change-Id: Ia33124bedbd260774a0a66f49aedd84e19c9971b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Make QList an alias to QVectorLars Knoll2019-10-301-3/+0
|/ | | | | | | | | | | | | This is almost 100% source compatible with Qt 5. Exceptions are * Stability of references for large or non movable types * taking a PMF for types that are now overloaded with r-value references in QVector * The missing prepend optimization in QVector (that is still planned to come for Qt 6) Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of itMarc Mutz2019-07-121-0/+1
| | | | | | | | | QLinkedList is still used in several tests. Add exceptions for these subdirs. Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove handling of missing Q_COMPILER_INITIALIZER_LISTSAllan Sandfeld Jensen2019-05-021-10/+0
| | | | | | Change-Id: Id65b39c787235a051262544932e6717d076f1ea0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHash/QMultiHash: add range constructorsMarc Mutz2019-04-251-0/+140
| | | | | | | | | | | | | | QMap and QMultiMap will go in a separate commit, due to QMap's insertion behavior that "reverses" the inserted elements. [ChangeLog][QtCore][QHash] Added range constructor. [ChangeLog][QtCore][QMultiHash] Added range constructor. Change-Id: Icfd0d0afde27792e8439ed6df3e8774696b134d3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Non-associative containers: add range constructorsMarc Mutz2019-04-171-0/+593
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Something nice we'd like to detect for array-backed containers is if the iterator passed is a Contiguous one; if the type is also trivially copyable / Q_PRIMITIVE_TYPE, we could memcpy() the whole range. However, there's no trait in the Standard to detect contiguous iterators (the best approximation would be detecting if the iterator is actually a pointer). Also, it's probably not smart to do the work now for QVector since QVector needs refactoring anyhow, and this work will be lost. QString and QByteArray are left in another commit. [ChangeLog][QtCore][QVector] Added range constructor. [ChangeLog][QtCore][QVarLengthArray] Added range constructor. [ChangeLog][QtCore][QList] Added range constructor. [ChangeLog][QtCore][QStringList] Added range constructor. [ChangeLog][QtCore][QLinkedList] Added range constructor. [ChangeLog][QtCore][QSet] Added range constructor. Change-Id: I220edb796053c9c4d31a6dbdc7efc5fc0f6678f9 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Add front()/back() to QString, QStringRef, QByteArray and QLatin1StringMarc Mutz2017-04-071-0/+16
| | | | | | | | | | | These STL-compatibility functions are present on our generic containers, but not on the string classes. [ChangeLog][QtCore][QString/QStringRef/QByteArray/QLatin1String] Added front() and back() for STL compatibility. Change-Id: I536019396b319abd1e2daf9c64ebab4e7a35b334 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a test for container API symmetryMarc Mutz2017-04-073-0/+92
Akin to the successful tst_QStringApiSymmetry, add such a test for generic containers, too. Yes, we have tst_collections, but it's a cut'n'paste mess that makes it hard to systematically perform cross-class checks for consistency. This new test, still in its infancy, uses templates and thus ensures that exactly the same checks are run on all containers. Starting out with front()/back(), which the string classes were found to lack, we will build this test up, as we did and continue to do with the string API one. Change-Id: I07323340b5612ecc658232b2776d788018010d0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>