diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2023-03-20 16:57:27 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2023-04-05 13:38:15 +0200 |
commit | 028c367f757b98008bb9209252e5617758c88e0a (patch) | |
tree | 528e3de4ccca38286b6b06a4ac9a0c2bbbd5b14b /src/corelib/thread/qfuture_impl.h | |
parent | 9b4b32ec98bf80023d2233a061564dfe59b783c7 (diff) |
Deprecate QtFuture::makeReadyFuture()
[ChangeLog][Deprecation Notice][QtCore] The QtFuture::makeReadyFuture()
method and all its specializations are deprecated since Qt 6.10.
The reason for the deprecation is that the method has a
makeReadyFuture(const QList<T> &) overload, which behaves differently
from all other overloads (including other non-const ref QList
overloads).
Use QtFuture::makeReadyVoidFuture() when you need a ready void QFuture,
or QtFuture::makeReadyValueFuture() when you need to propagate the
input type to the returned QFuture, or QtFuture::makeReadyRangeFuture()
when you need to create a multi-value future based on an input
container.
Fixes: QTBUG-109677
Change-Id: I55125269989df0a02840d5ddd5763ef5f1070df5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/thread/qfuture_impl.h')
-rw-r--r-- | src/corelib/thread/qfuture_impl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index b282903405..47a07801c7 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -1009,7 +1009,9 @@ static QFuture<std::decay_t<T>> makeReadyValueFuture(T &&value) Q_CORE_EXPORT QFuture<void> makeReadyVoidFuture(); // implemented in qfutureinterface.cpp +#if QT_DEPRECATED_SINCE(6, 10) template<typename T, typename = QtPrivate::EnableForNonVoid<T>> +QT_DEPRECATED_VERSION_X(6, 10, "Use makeReadyValueFuture() instead") static QFuture<std::decay_t<T>> makeReadyFuture(T &&value) { return makeReadyValueFuture(std::forward<T>(value)); @@ -1019,10 +1021,12 @@ static QFuture<std::decay_t<T>> makeReadyFuture(T &&value) // uses makeReadyVoidFuture() and required QFuture<void> to be defined. template<typename T> +QT_DEPRECATED_VERSION_X(6, 10, "Use makeReadyRangeFuture() instead") static QFuture<T> makeReadyFuture(const QList<T> &values) { return makeReadyRangeFuture(values); } +#endif // QT_DEPRECATED_SINCE(6, 10) #ifndef QT_NO_EXCEPTIONS |