Remove handling of missing Q_COMPILER_RVALUE_REFS

Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Allan Sandfeld Jensen 2019-04-02 16:23:48 +02:00
parent be56db2c49
commit 28c9e0e606
22 changed files with 0 additions and 52 deletions

View File

@ -225,13 +225,11 @@ struct PushBackWrapper
return c.push_back(u); return c.push_back(u);
} }
#ifdef Q_COMPILER_RVALUE_REFS
template <class C, class U> template <class C, class U>
inline void operator()(C &c, U &&u) const inline void operator()(C &c, U &&u) const
{ {
return c.push_back(u); return c.push_back(u);
} }
#endif
}; };
template <typename Functor, bool foo = HasResultType<Functor>::Value> template <typename Functor, bool foo = HasResultType<Functor>::Value>

View File

@ -109,9 +109,7 @@ public:
QT_DEPRECATED_X("Use QDir::setPath() instead") QT_DEPRECATED_X("Use QDir::setPath() instead")
QDir &operator=(const QString &path); QDir &operator=(const QString &path);
#endif #endif
#ifdef Q_COMPILER_RVALUE_REFS
QDir &operator=(QDir &&other) noexcept { swap(other); return *this; } QDir &operator=(QDir &&other) noexcept { swap(other); return *this; }
#endif
void swap(QDir &other) noexcept void swap(QDir &other) noexcept
{ qSwap(d_ptr, other.d_ptr); } { qSwap(d_ptr, other.d_ptr); }

View File

@ -67,9 +67,7 @@ public:
~QFileInfo(); ~QFileInfo();
QFileInfo &operator=(const QFileInfo &fileinfo); QFileInfo &operator=(const QFileInfo &fileinfo);
#ifdef Q_COMPILER_RVALUE_REFS
QFileInfo &operator=(QFileInfo &&other) noexcept { swap(other); return *this; } QFileInfo &operator=(QFileInfo &&other) noexcept { swap(other); return *this; }
#endif
void swap(QFileInfo &other) noexcept void swap(QFileInfo &other) noexcept
{ qSwap(d_ptr, other.d_ptr); } { qSwap(d_ptr, other.d_ptr); }

View File

@ -72,9 +72,7 @@ public:
QProcessEnvironment(); QProcessEnvironment();
QProcessEnvironment(const QProcessEnvironment &other); QProcessEnvironment(const QProcessEnvironment &other);
~QProcessEnvironment(); ~QProcessEnvironment();
#ifdef Q_COMPILER_RVALUE_REFS
QProcessEnvironment &operator=(QProcessEnvironment && other) noexcept { swap(other); return *this; } QProcessEnvironment &operator=(QProcessEnvironment && other) noexcept { swap(other); return *this; }
#endif
QProcessEnvironment &operator=(const QProcessEnvironment &other); QProcessEnvironment &operator=(const QProcessEnvironment &other);
void swap(QProcessEnvironment &other) noexcept { qSwap(d, other.d); } void swap(QProcessEnvironment &other) noexcept { qSwap(d, other.d); }

View File

@ -62,9 +62,7 @@ public:
~QStorageInfo(); ~QStorageInfo();
QStorageInfo &operator=(const QStorageInfo &other); QStorageInfo &operator=(const QStorageInfo &other);
#ifdef Q_COMPILER_RVALUE_REFS
QStorageInfo &operator=(QStorageInfo &&other) noexcept { swap(other); return *this; } QStorageInfo &operator=(QStorageInfo &&other) noexcept { swap(other); return *this; }
#endif
inline void swap(QStorageInfo &other) noexcept inline void swap(QStorageInfo &other) noexcept
{ qSwap(d, other.d); } { qSwap(d, other.d); }

View File

@ -182,12 +182,10 @@ public:
QUrl(const QString &url, ParsingMode mode = TolerantMode); QUrl(const QString &url, ParsingMode mode = TolerantMode);
QUrl &operator=(const QString &url); QUrl &operator=(const QString &url);
#endif #endif
#ifdef Q_COMPILER_RVALUE_REFS
QUrl(QUrl &&other) noexcept : d(other.d) QUrl(QUrl &&other) noexcept : d(other.d)
{ other.d = nullptr; } { other.d = nullptr; }
inline QUrl &operator=(QUrl &&other) noexcept inline QUrl &operator=(QUrl &&other) noexcept
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif
~QUrl(); ~QUrl();
inline void swap(QUrl &other) noexcept { qSwap(d, other.d); } inline void swap(QUrl &other) noexcept { qSwap(d, other.d); }

View File

@ -70,9 +70,7 @@ public:
QUrlQuery(const QUrlQuery &other); QUrlQuery(const QUrlQuery &other);
QUrlQuery &operator=(const QUrlQuery &other); QUrlQuery &operator=(const QUrlQuery &other);
#ifdef Q_COMPILER_RVALUE_REFS
QUrlQuery &operator=(QUrlQuery &&other) noexcept { swap(other); return *this; } QUrlQuery &operator=(QUrlQuery &&other) noexcept { swap(other); return *this; }
#endif
~QUrlQuery(); ~QUrlQuery();
bool operator==(const QUrlQuery &other) const; bool operator==(const QUrlQuery &other) const;

View File

@ -117,12 +117,10 @@ public:
inline bool operator!=(const QPersistentModelIndex &other) const inline bool operator!=(const QPersistentModelIndex &other) const
{ return !operator==(other); } { return !operator==(other); }
QPersistentModelIndex &operator=(const QPersistentModelIndex &other); QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QPersistentModelIndex(QPersistentModelIndex &&other) noexcept inline QPersistentModelIndex(QPersistentModelIndex &&other) noexcept
: d(other.d) { other.d = nullptr; } : d(other.d) { other.d = nullptr; }
inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) noexcept inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) noexcept
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif
inline void swap(QPersistentModelIndex &other) noexcept { qSwap(d, other.d); } inline void swap(QPersistentModelIndex &other) noexcept { qSwap(d, other.d); }
bool operator==(const QModelIndex &other) const; bool operator==(const QModelIndex &other) const;
bool operator!=(const QModelIndex &other) const; bool operator!=(const QModelIndex &other) const;

View File

@ -60,12 +60,10 @@ public:
// ### Qt 6: remove them all, the compiler-generated ones are fine // ### Qt 6: remove them all, the compiler-generated ones are fine
inline QItemSelectionRange(const QItemSelectionRange &other) inline QItemSelectionRange(const QItemSelectionRange &other)
: tl(other.tl), br(other.br) {} : tl(other.tl), br(other.br) {}
# ifdef Q_COMPILER_RVALUE_REFS
QItemSelectionRange(QItemSelectionRange &&other) noexcept QItemSelectionRange(QItemSelectionRange &&other) noexcept
: tl(std::move(other.tl)), br(std::move(other.br)) {} : tl(std::move(other.tl)), br(std::move(other.br)) {}
QItemSelectionRange &operator=(QItemSelectionRange &&other) noexcept QItemSelectionRange &operator=(QItemSelectionRange &&other) noexcept
{ tl = std::move(other.tl); br = std::move(other.br); return *this; } { tl = std::move(other.tl); br = std::move(other.br); return *this; }
# endif
QItemSelectionRange &operator=(const QItemSelectionRange &other) QItemSelectionRange &operator=(const QItemSelectionRange &other)
{ tl = other.tl; br = other.br; return *this; } { tl = other.tl; br = other.br; return *this; }
#endif // Qt < 6 #endif // Qt < 6

View File

@ -544,10 +544,8 @@ public:
inline explicit QSignalBlocker(QObject &o) noexcept; inline explicit QSignalBlocker(QObject &o) noexcept;
inline ~QSignalBlocker(); inline ~QSignalBlocker();
#ifdef Q_COMPILER_RVALUE_REFS
inline QSignalBlocker(QSignalBlocker &&other) noexcept; inline QSignalBlocker(QSignalBlocker &&other) noexcept;
inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept; inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept;
#endif
inline void reblock() noexcept; inline void reblock() noexcept;
inline void unblock() noexcept; inline void unblock() noexcept;
@ -570,7 +568,6 @@ QSignalBlocker::QSignalBlocker(QObject &o) noexcept
m_inhibited(false) m_inhibited(false)
{} {}
#ifdef Q_COMPILER_RVALUE_REFS
QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept
: m_o(other.m_o), : m_o(other.m_o),
m_blocked(other.m_blocked), m_blocked(other.m_blocked),
@ -594,7 +591,6 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) noexcept
} }
return *this; return *this;
} }
#endif
QSignalBlocker::~QSignalBlocker() QSignalBlocker::~QSignalBlocker()
{ {

View File

@ -145,7 +145,6 @@ QPpsAttribute &QPpsAttribute::operator=(const QPpsAttribute &other)
return *this; return *this;
} }
#ifdef Q_COMPILER_RVALUE_REFS
QPpsAttribute::QPpsAttribute(QPpsAttribute &&other) : d(other.d) QPpsAttribute::QPpsAttribute(QPpsAttribute &&other) : d(other.d)
{ {
other.d->type = QPpsAttribute::None; other.d->type = QPpsAttribute::None;
@ -156,7 +155,6 @@ QPpsAttribute &QPpsAttribute::operator=(QPpsAttribute &&other)
qSwap(d, other.d); qSwap(d, other.d);
return *this; return *this;
} }
#endif
bool QPpsAttribute::operator==(const QPpsAttribute &other) const bool QPpsAttribute::operator==(const QPpsAttribute &other) const
{ {

View File

@ -96,10 +96,8 @@ public:
bool operator==(const QPpsAttribute &other) const; bool operator==(const QPpsAttribute &other) const;
bool operator!=(const QPpsAttribute &other) const; bool operator!=(const QPpsAttribute &other) const;
#ifdef Q_COMPILER_RVALUE_REFS
QPpsAttribute(QPpsAttribute &&other); QPpsAttribute(QPpsAttribute &&other);
QPpsAttribute &operator=(QPpsAttribute &&other); QPpsAttribute &operator=(QPpsAttribute &&other);
#endif
bool isValid() const; bool isValid() const;
Type type() const; Type type() const;

View File

@ -267,12 +267,10 @@ class Q_CORE_EXPORT QVariant
#endif #endif
QVariant& operator=(const QVariant &other); QVariant& operator=(const QVariant &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QVariant(QVariant &&other) noexcept : d(other.d) inline QVariant(QVariant &&other) noexcept : d(other.d)
{ other.d = Private(); } { other.d = Private(); }
inline QVariant &operator=(QVariant &&other) noexcept inline QVariant &operator=(QVariant &&other) noexcept
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif
inline void swap(QVariant &other) noexcept { qSwap(d, other.d); } inline void swap(QVariant &other) noexcept { qSwap(d, other.d); }

View File

@ -78,9 +78,7 @@ public:
QMimeType(); QMimeType();
QMimeType(const QMimeType &other); QMimeType(const QMimeType &other);
QMimeType &operator=(const QMimeType &other); QMimeType &operator=(const QMimeType &other);
#ifdef Q_COMPILER_RVALUE_REFS
QMimeType &operator=(QMimeType &&other) noexcept { swap(other); return *this; } QMimeType &operator=(QMimeType &&other) noexcept { swap(other); return *this; }
#endif
void swap(QMimeType &other) noexcept void swap(QMimeType &other) noexcept
{ {
qSwap(d, other.d); qSwap(d, other.d);

View File

@ -103,7 +103,6 @@ QT_END_NAMESPACE
} \ } \
QT_END_NAMESPACE QT_END_NAMESPACE
#ifdef Q_COMPILER_RVALUE_REFS
#define QMIMETYPE_BUILDER_FROM_RVALUE_REFS \ #define QMIMETYPE_BUILDER_FROM_RVALUE_REFS \
QT_BEGIN_NAMESPACE \ QT_BEGIN_NAMESPACE \
static QMimeType buildQMimeType ( \ static QMimeType buildQMimeType ( \
@ -122,6 +121,5 @@ QT_END_NAMESPACE
return QMimeType(qMimeTypeData); \ return QMimeType(qMimeTypeData); \
} \ } \
QT_END_NAMESPACE QT_END_NAMESPACE
#endif
#endif // QMIMETYPE_P_H #endif // QMIMETYPE_P_H

View File

@ -59,19 +59,15 @@ public:
inline QXmlStreamStringRef(const QStringRef &aString) inline QXmlStreamStringRef(const QStringRef &aString)
:m_string(aString.string()?*aString.string():QString()), m_position(aString.position()), m_size(aString.size()){} :m_string(aString.string()?*aString.string():QString()), m_position(aString.position()), m_size(aString.size()){}
QXmlStreamStringRef(const QString &aString) : m_string(aString), m_position(0), m_size(m_string.size()) {} QXmlStreamStringRef(const QString &aString) : m_string(aString), m_position(0), m_size(m_string.size()) {}
#ifdef Q_COMPILER_RVALUE_REFS
QXmlStreamStringRef(QString &&aString) noexcept : m_string(std::move(aString)), m_position(0), m_size(m_string.size()) {} QXmlStreamStringRef(QString &&aString) noexcept : m_string(std::move(aString)), m_position(0), m_size(m_string.size()) {}
#endif
#if QT_VERSION < QT_VERSION_CHECK(6,0,0) #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QXmlStreamStringRef(const QXmlStreamStringRef &other) // = default QXmlStreamStringRef(const QXmlStreamStringRef &other) // = default
: m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {} : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
#ifdef Q_COMPILER_RVALUE_REFS
QXmlStreamStringRef(QXmlStreamStringRef &&other) noexcept // = default QXmlStreamStringRef(QXmlStreamStringRef &&other) noexcept // = default
: m_string(std::move(other.m_string)), m_position(other.m_position), m_size(other.m_size) {} : m_string(std::move(other.m_string)), m_position(other.m_position), m_size(other.m_size) {}
QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) noexcept // = default QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) noexcept // = default
{ swap(other); return *this; } { swap(other); return *this; }
#endif
QXmlStreamStringRef &operator=(const QXmlStreamStringRef &other) // = default QXmlStreamStringRef &operator=(const QXmlStreamStringRef &other) // = default
{ m_string = other.m_string; m_position = other.m_position; m_size = other.m_size; return *this; } { m_string = other.m_string; m_position = other.m_position; m_size = other.m_size; return *this; }
inline ~QXmlStreamStringRef() {} // ### this prevents (or deprecates) all the move/copy special member functions, inline ~QXmlStreamStringRef() {} // ### this prevents (or deprecates) all the move/copy special member functions,
@ -111,7 +107,6 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value); QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value);
QXmlStreamAttribute(const QXmlStreamAttribute &); QXmlStreamAttribute(const QXmlStreamAttribute &);
#ifdef Q_COMPILER_RVALUE_REFS
QXmlStreamAttribute(QXmlStreamAttribute &&other) noexcept // = default; QXmlStreamAttribute(QXmlStreamAttribute &&other) noexcept // = default;
: m_name(std::move(other.m_name)), : m_name(std::move(other.m_name)),
m_namespaceUri(std::move(other.m_namespaceUri)), m_namespaceUri(std::move(other.m_namespaceUri)),
@ -132,7 +127,6 @@ public:
m_isDefault = other.m_isDefault; m_isDefault = other.m_isDefault;
return *this; return *this;
} }
#endif
QXmlStreamAttribute& operator=(const QXmlStreamAttribute &); QXmlStreamAttribute& operator=(const QXmlStreamAttribute &);
~QXmlStreamAttribute(); ~QXmlStreamAttribute();
#endif // < Qt 6 #endif // < Qt 6

View File

@ -82,7 +82,6 @@ public:
return *this; return *this;
} }
#ifdef Q_COMPILER_RVALUE_REFS
QArrayDataPointer(QArrayDataPointer &&other) noexcept QArrayDataPointer(QArrayDataPointer &&other) noexcept
: d(other.d) : d(other.d)
{ {
@ -95,7 +94,6 @@ public:
this->swap(moved); this->swap(moved);
return *this; return *this;
} }
#endif
DataOps &operator*() const DataOps &operator*() const
{ {

View File

@ -58,11 +58,9 @@ public:
explicit QBitArray(int size, bool val = false); explicit QBitArray(int size, bool val = false);
QBitArray(const QBitArray &other) : d(other.d) {} QBitArray(const QBitArray &other) : d(other.d) {}
inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; } inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; }
#ifdef Q_COMPILER_RVALUE_REFS
inline QBitArray(QBitArray &&other) noexcept : d(std::move(other.d)) {} inline QBitArray(QBitArray &&other) noexcept : d(std::move(other.d)) {}
inline QBitArray &operator=(QBitArray &&other) noexcept inline QBitArray &operator=(QBitArray &&other) noexcept
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif
inline void swap(QBitArray &other) noexcept { qSwap(d, other.d); } inline void swap(QBitArray &other) noexcept { qSwap(d, other.d); }

View File

@ -177,11 +177,9 @@ public:
QByteArray &operator=(const QByteArray &) noexcept; QByteArray &operator=(const QByteArray &) noexcept;
QByteArray &operator=(const char *str); QByteArray &operator=(const char *str);
#ifdef Q_COMPILER_RVALUE_REFS
inline QByteArray(QByteArray && other) noexcept : d(other.d) { other.d = Data::sharedNull(); } inline QByteArray(QByteArray && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
inline QByteArray &operator=(QByteArray &&other) noexcept inline QByteArray &operator=(QByteArray &&other) noexcept
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif
inline void swap(QByteArray &other) noexcept inline void swap(QByteArray &other) noexcept
{ qSwap(d, other.d); } { qSwap(d, other.d); }

View File

@ -57,10 +57,8 @@ public:
QCollatorSortKey(const QCollatorSortKey &other); QCollatorSortKey(const QCollatorSortKey &other);
~QCollatorSortKey(); ~QCollatorSortKey();
QCollatorSortKey &operator=(const QCollatorSortKey &other); QCollatorSortKey &operator=(const QCollatorSortKey &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QCollatorSortKey &operator=(QCollatorSortKey &&other) noexcept inline QCollatorSortKey &operator=(QCollatorSortKey &&other) noexcept
{ swap(other); return *this; } { swap(other); return *this; }
#endif
void swap(QCollatorSortKey &other) noexcept void swap(QCollatorSortKey &other) noexcept
{ d.swap(other.d); } { d.swap(other.d); }
@ -87,12 +85,10 @@ public:
QCollator(const QCollator &); QCollator(const QCollator &);
~QCollator(); ~QCollator();
QCollator &operator=(const QCollator &); QCollator &operator=(const QCollator &);
#ifdef Q_COMPILER_RVALUE_REFS
QCollator(QCollator &&other) noexcept QCollator(QCollator &&other) noexcept
: d(other.d) { other.d = nullptr; } : d(other.d) { other.d = nullptr; }
QCollator &operator=(QCollator &&other) noexcept QCollator &operator=(QCollator &&other) noexcept
{ swap(other); return *this; } { swap(other); return *this; }
#endif
void swap(QCollator &other) noexcept void swap(QCollator &other) noexcept
{ qSwap(d, other.d); } { qSwap(d, other.d); }

View File

@ -71,9 +71,7 @@ public:
~QCommandLineOption(); ~QCommandLineOption();
QCommandLineOption &operator=(const QCommandLineOption &other); QCommandLineOption &operator=(const QCommandLineOption &other);
#ifdef Q_COMPILER_RVALUE_REFS
QCommandLineOption &operator=(QCommandLineOption &&other) noexcept { swap(other); return *this; } QCommandLineOption &operator=(QCommandLineOption &&other) noexcept { swap(other); return *this; }
#endif
void swap(QCommandLineOption &other) noexcept void swap(QCommandLineOption &other) noexcept
{ qSwap(d, other.d); } { qSwap(d, other.d); }

View File

@ -107,10 +107,8 @@ public:
#endif #endif
QContiguousCache<T> &operator=(const QContiguousCache<T> &other); QContiguousCache<T> &operator=(const QContiguousCache<T> &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QContiguousCache<T> &operator=(QContiguousCache<T> &&other) inline QContiguousCache<T> &operator=(QContiguousCache<T> &&other)
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif
inline void swap(QContiguousCache<T> &other) { qSwap(d, other.d); } inline void swap(QContiguousCache<T> &other) { qSwap(d, other.d); }
bool operator==(const QContiguousCache<T> &other) const; bool operator==(const QContiguousCache<T> &other) const;
inline bool operator!=(const QContiguousCache<T> &other) const { return !(*this == other); } inline bool operator!=(const QContiguousCache<T> &other) const { return !(*this == other); }