diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h index 748b3a54031..8c04b8c4376 100644 --- a/src/corelib/thread/qfuture.h +++ b/src/corelib/thread/qfuture.h @@ -59,10 +59,9 @@ class QFutureWatcher; template class QFuture { - static_assert (std::is_copy_constructible_v - || std::is_move_constructible_v + static_assert (std::is_move_constructible_v || std::is_same_v, - "Type with copy or move constructors or type void is required"); + "A move-constructible type or type void is required"); public: QFuture() : d(QFutureInterface::canceledResult()) diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h index 68645ef084c..e453f29b6af 100644 --- a/src/corelib/thread/qpromise.h +++ b/src/corelib/thread/qpromise.h @@ -52,10 +52,9 @@ QT_BEGIN_NAMESPACE template class QPromise { - static_assert (std::is_copy_constructible_v - || std::is_move_constructible_v + static_assert (std::is_move_constructible_v || std::is_same_v, - "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) diff --git a/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp b/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp index 8321b4126fc..52f4daa24af 100644 --- a/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp +++ b/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp @@ -77,7 +77,6 @@ private slots: struct TrivialType { int field = 0; }; struct CopyOnlyType { - Q_DISABLE_MOVE(CopyOnlyType) constexpr CopyOnlyType(int field = 0) noexcept : field(field) {} CopyOnlyType(const CopyOnlyType &) = default; CopyOnlyType& operator=(const CopyOnlyType &) = default;