diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-05-19 10:37:24 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-05-21 11:08:11 +0200 |
commit | bf22f914410b37031acdf39ea8fef89cbbf2ca28 (patch) | |
tree | 6a6762b8c7f0542ce73b49f6b52ba54146818caf /src/corelib/thread | |
parent | 973700c54678803a2600dfa60112f29f15705197 (diff) |
QFuture/QPromise: don't check for is_copy_constructible
The check is over-arching. is_move_constructible is sufficient;
we don't have to support "ridiculous" types that are copiable but
have deleted move operations (such types are fundamentally broken).
This is in line with the Move* (legacy) named requirements.
Change-Id: Idc7116b39013501b9be39628a4e7afd35fe15530
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qfuture.h | 5 | ||||
-rw-r--r-- | src/corelib/thread/qpromise.h | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h index 748b3a5403..8c04b8c437 100644 --- a/src/corelib/thread/qfuture.h +++ b/src/corelib/thread/qfuture.h @@ -59,10 +59,9 @@ class QFutureWatcher; template <typename T> class QFuture { - static_assert (std::is_copy_constructible_v<T> - || std::is_move_constructible_v<T> + static_assert (std::is_move_constructible_v<T> || std::is_same_v<T, void>, - "Type with copy or move constructors or type void is required"); + "A move-constructible type or type void is required"); public: QFuture() : d(QFutureInterface<T>::canceledResult()) diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h index 68645ef084..e453f29b6a 100644 --- a/src/corelib/thread/qpromise.h +++ b/src/corelib/thread/qpromise.h @@ -52,10 +52,9 @@ QT_BEGIN_NAMESPACE template<typename T> class QPromise { - static_assert (std::is_copy_constructible_v<T> - || std::is_move_constructible_v<T> + static_assert (std::is_move_constructible_v<T> || std::is_same_v<T, void>, - "Type with copy or move constructors or type void is required"); + "A move-constructible type or type void is required"); public: QPromise() = default; Q_DISABLE_COPY(QPromise) |