From 1daaf613dc56c5ffedefe7ca6938ae5b191f9411 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 24 Jan 2022 09:25:38 +0100 Subject: [PATCH] QFuture: add a missing include for qpromise.h QPromise is now used in qfuture_impl.h, so we need to include it. Remove qfuture.h include from qpromise.h, to avoid circular dependency. As a drive-by, simplify a type-trait: is_convertible_v is true whenever is_same_v is, so we don't need to instantiate both. Fixes: QTBUG-100144 Pick-to: 6.3 6.2 Change-Id: Ic6df43d96d9d168cc44c2949e41c5e490f4c50ce Reviewed-by: Marc Mutz --- src/corelib/thread/qfuture_impl.h | 5 +---- src/corelib/thread/qpromise.h | 9 ++++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index b09d84a6d3..2924408333 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -51,6 +51,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -82,10 +83,6 @@ WhenAnyResult(qsizetype, const QFuture &) -> WhenAnyResult; namespace QtPrivate { -template -using EnableIfSameOrConvertible = std::enable_if_t - || std::is_convertible_v>; - template using EnableForVoid = std::enable_if_t>; diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h index f62a2a54e3..f7abf8babc 100644 --- a/src/corelib/thread/qpromise.h +++ b/src/corelib/thread/qpromise.h @@ -41,7 +41,7 @@ #define QPROMISE_H #include -#include +#include #include @@ -49,6 +49,13 @@ QT_REQUIRE_CONFIG(future); QT_BEGIN_NAMESPACE +namespace QtPrivate { + +template +using EnableIfSameOrConvertible = std::enable_if_t>; + +} // namespace QtPrivate + template class QPromise {