qt6-bb10/tests/auto
Timur Pocheptsov 44ceb56455 QFuture - add ability to move results from QFuture
QFuture's original design pre-dates C++11 and its
introduction of move semantics. QFuture is documented
as requiring copy-constructible classes and uses copy
operations for results (which in Qt's universe in general
is relatively cheap, due to the use of COW/data sharing).
QFuture::result(), QFuture::results(), QFuture::resultAt()
return copies. Now that the year is 2020, it makes some
sense to add support for move semantics and, in particular,
move-only types, like std::unique_ptr (that cannot be
obtained from QFuture using result etc.). Taking a result
or results from a QFuture renders it invalid.  This patch
adds QFuture<T>::takeResults(), takeResult() and isValid().
'Taking' functions are 'enabled_if' for non-void types only
to improve the compiler's diagnostic (which would otherwise
spit some semi-articulate diagnostic).
As a bonus a bug was found in the pre-existing code (after
initially copy and pasted into the new function) - the one
where we incorrectly report ready results in (rather obscure)
filter mode.

Fixes: QTBUG-81941
Fixes: QTBUG-83182
Change-Id: I8ccdfc50aa310a3a79eef2cdc55f5ea210f889c3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-31 15:28:23 +02:00
..
cmake Remove qt6_use_modules 2020-03-25 08:39:43 +01:00
concurrent QtConcurrent: add fluent interface to configure a task before run 2020-03-29 20:44:32 +01:00
corelib QFuture - add ability to move results from QFuture 2020-03-31 15:28:23 +02:00
dbus New QMetaType representation 2020-02-20 16:11:02 +01:00
gui Move undo framework out of Qt Widgets 2020-03-30 12:36:29 +02:00
guiapplauncher
installed_cmake
network Port autotest to QRegularExpression 2020-03-31 15:28:23 +02:00
opengl Merge remote-tracking branch 'origin/5.15' into dev 2020-03-11 15:34:21 +01:00
other cmake: Remove APPLE prefix from platform names 2020-03-16 17:57:56 +01:00
printsupport Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
shared QWindowsFontDatabase: Check preferred family names for all fonts 2019-11-29 09:31:21 +01:00
sql tst_sqlquery: Skip datetime test if no database drivers are available 2020-03-23 13:09:00 +01:00
testlib Restructure testlib selftest project 2020-03-24 21:04:43 +01:00
tools Port test to QRegularExpression 2020-03-31 15:28:23 +02:00
widgets Move undo framework out of Qt Widgets 2020-03-30 12:36:29 +02:00
xml Merge remote-tracking branch 'origin/5.15' into dev 2020-03-16 18:41:27 +01:00
CMakeLists.txt cmake: Remove APPLE prefix from platform names 2020-03-16 17:57:56 +01:00
auto.pro Disable tests with qemu-arm & developer-build configurations in the CI 2019-10-03 15:12:33 +00:00
network-settings.h Revert "QAbstractSocket: deprecate 'error' member-function" 2020-02-26 23:07:52 +03:00