qt5base-lts/tests/auto/corelib/tools
Giuseppe D'Angelo 8e98a161e9 Long live std::pair!
Make QPair an alias for std::pair, and qMakePair just a forwarder
towards std::make_pair.

Why? Fundamentally to ditch a bunch of NIH code; gain for free
structured bindings, std::tuple and std::reference_wrapper
compatibility, and so on.

Breakages:

* Some that code manually forward declares QPair.
We don't care about it (<QContainerFwd> is the proper way).

* Some code that overloads on std::pair and QPair. Luckily
it's mostly centralized: debug, metatypes, testing macros.
Just remove the QPair overload.

* Usages of qMakePair forcing the template type parameters.
There are a handful of these in qtbase, but only one was actually
broken.

* std::pair is NOT (and will never likely be) trivially copiable.
This is agreed to be a mistake done by practically all implementations
in C++11, can can't be fixed without breaking ABI.
Some code using QPair assuming it's trivially copiable may break;
exactly one occurrence was in qtbase.

* QMetaType logic extracts the type names in two different ways,
one by looking at the source code string (e.g. extracted by moc)
and one via some ad-hoc reflection in C++. We need to make
"QPair" (as spelled in the source code) be the same as "std::pair"
(gathered via reflection, which will see through the alias)
when compared. The way it's already done e.g. for QList is
by actually replacing the moc-extracted name with the name
of the actual type used in C++; do the same here.
On libc++, std::pair is actually in an inline namespace --
i.e. std::__1::pair; the reflection will extract and store
"std::__1::pair" so we need an ad-hoc fix to QMetaType.

[ChangeLog][QtCore][QPair] QPair is now an alias to std::pair,
and does not exist as a class in Qt any more. This may break
code such as functions overloaded for both QPair and std::pair.
Usually, the overload taking a QPair can be safely discarded,
leaving only the one taking a std::pair. QPair API has not changed,
and qMakePair is still available for compatibility (although
new code is encouraged to use std::pair and std::make_pair
directly instead).

Change-Id: I7725c751bf23946cde577b1406e86a336c0a3dcf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-10 16:49:08 +02:00
..
collections Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
containerapisymmetry Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qalgorithms Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qarraydata Enforce that statically allocated array-like containers have 0 capacity 2020-05-14 14:19:47 +02:00
qbitarray Merge remote-tracking branch 'origin/dev' into merge-dev 2020-01-24 13:17:33 +01:00
qcache Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
qcommandlineparser Merge remote-tracking branch 'origin/5.15' into dev 2020-05-04 17:38:40 +02:00
qcontiguouscache Extend QContiguousCache to use qsizetype for size and indices 2020-03-14 10:36:47 +01:00
qcryptographichash Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qeasingcurve Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
qexplicitlyshareddatapointer Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qflatmap Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qfreelist Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qhash Implement emplace() for QHash and QMultiHash 2020-04-09 20:03:32 +02:00
qhashfunctions QChar: make std::hash'able 2020-05-05 18:58:26 +02:00
qline Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qlinkedlist Merge remote-tracking branch 'origin/5.15' into dev 2020-03-11 15:34:21 +01:00
qmacautoreleasepool Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qmakearray Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qmap Merge remote-tracking branch 'origin/5.15' into dev 2020-03-04 14:39:18 +00:00
qmargins Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qmessageauthenticationcode Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qoffsetstringarray Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
qpair Long live std::pair! 2020-06-10 16:49:08 +02:00
qpoint Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qpointf Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qqueue Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qrect Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qringbuffer Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qscopedpointer Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qscopedvaluerollback Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qscopeguard Merge remote-tracking branch 'origin/5.15' into dev 2020-04-08 20:11:39 +02:00
qset Change qHash() to work with size_t instead of uint 2020-04-09 20:03:25 +02:00
qsharedpointer Cleanup code where we mixed QHash and QMultiHash iterator code 2020-02-03 17:43:30 +01:00
qsize Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qsizef Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qstl Regenerate tests/auto/corelib/tools 2019-11-12 17:26:27 +00:00
qtaggedpointer QTaggedPointer: verify constexpr'ness of some ctors 2020-05-16 08:55:28 +02:00
qtimeline Merge remote-tracking branch 'origin/dev' into wip/cmake 2020-01-29 16:57:27 +01:00
qvarlengtharray Use qsizetype for size related methods in QVarlengthArray 2020-03-14 10:36:56 +01:00
qvector Stabilize autotest 2020-06-01 20:57:55 +02:00
qversionnumber Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
.prev_CMakeLists.txt Introduce helper class QTaggedPointer 2020-03-17 10:01:04 +01:00
CMakeLists.txt Port more tests from tests/auto/corelib/tools to CMake 2020-04-29 22:48:45 +02:00
tools.pro Introduce helper class QTaggedPointer 2020-03-17 10:01:04 +01:00