summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-10-29 12:41:11 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-10-29 14:19:35 +0100
commit30a1683f65fa0d01eceb7e1293abc84108d76e7f (patch)
tree692bb6f8d135ae486f07fcc890f190874710d664 /src
parent387f3e00a8d74984d33af990a1e1f57cd87aae61 (diff)
Remove the comparison operators of QFuture
These operators don't do what the user might expect and may lead to confusing results. [ChangeLog][Source-Incompatible Changes][QFuture] The comparison operators of QFuture have been removed. They were comparing the underlying d-ptrs instead of comparing the results (as the users might expect), which is not very helpful for the users point of view. Change-Id: I80a887610eac38b60329128cca52cdb5fb515207 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qfuture.h3
-rw-r--r--src/corelib/thread/qfuture.qdoc11
-rw-r--r--src/corelib/thread/qfuturewatcher.h2
3 files changed, 1 insertions, 15 deletions
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h
index 70cc206f13..c5966f7893 100644
--- a/src/corelib/thread/qfuture.h
+++ b/src/corelib/thread/qfuture.h
@@ -101,9 +101,6 @@ public:
operator T() const;
#endif
- bool operator==(const QFuture &other) const { return (d == other.d); }
- bool operator!=(const QFuture &other) const { return (d != other.d); }
-
void cancel() { d.cancel(); }
bool isCanceled() const { return d.isCanceled(); }
diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc
index c1ead6b893..59f80da4af 100644
--- a/src/corelib/thread/qfuture.qdoc
+++ b/src/corelib/thread/qfuture.qdoc
@@ -167,17 +167,6 @@
Assigns \a other to this future and returns a reference to this future.
*/
-/*! \fn template <typename T> bool QFuture<T>::operator==(const QFuture &other) const
-
- Returns \c true if \a other is a copy of this future; otherwise returns \c false.
-*/
-
-/*! \fn template <typename T> bool QFuture<T>::operator!=(const QFuture &other) const
-
- Returns \c true if \a other is \e not a copy of this future; otherwise returns
- false.
-*/
-
/*! \fn template <typename T> void QFuture<T>::cancel()
Cancels the asynchronous computation represented by this future. Note that
diff --git a/src/corelib/thread/qfuturewatcher.h b/src/corelib/thread/qfuturewatcher.h
index 4a630dfbe8..0e7490d9a5 100644
--- a/src/corelib/thread/qfuturewatcher.h
+++ b/src/corelib/thread/qfuturewatcher.h
@@ -210,7 +210,7 @@ private:
template <typename T>
Q_INLINE_TEMPLATE void QFutureWatcher<T>::setFuture(const QFuture<T> &_future)
{
- if (_future == m_future)
+ if (_future.d == m_future.d)
return;
disconnectOutputInterface(true);