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 <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2016-08-07 16:40:07 +03:00
parent fcd3c11945
commit 9c016cefe9
2 changed files with 1 additions and 34 deletions

View File

@ -65,13 +65,7 @@ public:
explicit QFuture(QFutureInterface<T> *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<T> d;
};
template <typename T>
inline QFuture<T> &QFuture<T>::operator=(const QFuture<T> &other)
{
d = other.d;
return *this;
}
template <typename T>
inline T QFuture<T>::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<void> &QFuture<void>::operator=(const QFuture<void> &other)
{
d = other.d;
return *this;
}
inline QFuture<void> QFutureInterface<void>::future()
{
return QFuture<void>(this);

View File

@ -285,21 +285,13 @@ template <>
class QFutureInterface<void> : public QFutureInterfaceBase
{
public:
QFutureInterface<void>(State initialState = NoState)
explicit QFutureInterface<void>(State initialState = NoState)
: QFutureInterfaceBase(initialState)
{ }
QFutureInterface<void>(const QFutureInterface<void> &other)
: QFutureInterfaceBase(other)
{ }
static QFutureInterface<void> canceledResult()
{ return QFutureInterface(State(Started | Finished | Canceled)); }
QFutureInterface<void> &operator=(const QFutureInterface<void> &other)
{
QFutureInterfaceBase::operator=(other);
return *this;
}
inline QFuture<void> future(); // implemented in qfuture.h