From 9c016cefe9a81de3b01019cb1eb1363b05e3b448 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 7 Aug 2016 16:40:07 +0300 Subject: QFuture(Interface): remove unneeded special member functions The compiler-generated ones are just fine. This is BC because the class is not exported and QFutureInterfaceBase (needlessly) contains virtual functions (the dtor), so this class will never be trivially copyable. It's also not movable, until I figure out how to add move special member functions to QFutureInterfaceBase. Also made the QFutureInterface(State) constructor explicit, because a State is not a faithful representation of a QFutureInterface. Change-Id: Ifa44f87b41c4ee3c5167c282512ec4860075671d Reviewed-by: Thiago Macieira --- src/corelib/thread/qfuture.h | 25 ------------------------- src/corelib/thread/qfutureinterface.h | 10 +--------- 2 files changed, 1 insertion(+), 34 deletions(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h index 7ae5c68bb9..1f0c747f40 100644 --- a/src/corelib/thread/qfuture.h +++ b/src/corelib/thread/qfuture.h @@ -65,13 +65,7 @@ public: explicit QFuture(QFutureInterface *p) // internal : d(*p) { } - QFuture(const QFuture &other) - : d(other.d) - { } - ~QFuture() - { } - inline QFuture &operator=(const QFuture &other); bool operator==(const QFuture &other) const { return (d == other.d); } bool operator!=(const QFuture &other) const { return (d != other.d); } @@ -156,13 +150,6 @@ public: // Warning: the d pointer is not documented and is considered private. mutable QFutureInterface d; }; -template -inline QFuture &QFuture::operator=(const QFuture &other) -{ - d = other.d; - return *this; -} - template inline T QFuture::result() const { @@ -195,13 +182,7 @@ public: explicit QFuture(QFutureInterfaceBase *p) // internal : d(*p) { } - QFuture(const QFuture &other) - : d(other.d) - { } - ~QFuture() - { } - QFuture &operator=(const QFuture &other); bool operator==(const QFuture &other) const { return (d == other.d); } bool operator!=(const QFuture &other) const { return (d != other.d); } @@ -248,12 +229,6 @@ public: mutable QFutureInterfaceBase d; }; -inline QFuture &QFuture::operator=(const QFuture &other) -{ - d = other.d; - return *this; -} - inline QFuture QFutureInterface::future() { return QFuture(this); diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index 1787ff3b93..559d26e231 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -285,21 +285,13 @@ template <> class QFutureInterface : public QFutureInterfaceBase { public: - QFutureInterface(State initialState = NoState) + explicit QFutureInterface(State initialState = NoState) : QFutureInterfaceBase(initialState) { } - QFutureInterface(const QFutureInterface &other) - : QFutureInterfaceBase(other) - { } static QFutureInterface canceledResult() { return QFutureInterface(State(Started | Finished | Canceled)); } - QFutureInterface &operator=(const QFutureInterface &other) - { - QFutureInterfaceBase::operator=(other); - return *this; - } inline QFuture future(); // implemented in qfuture.h -- cgit v1.2.3