Remove handling of missing Q_COMPILER_RVALUE_REFS
Change-Id: I7bc6c455fbae4cdad584c76773299a6d8cd40c82 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
be56db2c49
commit
28c9e0e606
@ -225,13 +225,11 @@ struct PushBackWrapper
|
||||
return c.push_back(u);
|
||||
}
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
template <class C, class U>
|
||||
inline void operator()(C &c, U &&u) const
|
||||
{
|
||||
return c.push_back(u);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename Functor, bool foo = HasResultType<Functor>::Value>
|
||||
|
@ -109,9 +109,7 @@ public:
|
||||
QT_DEPRECATED_X("Use QDir::setPath() instead")
|
||||
QDir &operator=(const QString &path);
|
||||
#endif
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QDir &operator=(QDir &&other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
|
||||
void swap(QDir &other) noexcept
|
||||
{ qSwap(d_ptr, other.d_ptr); }
|
||||
|
@ -67,9 +67,7 @@ public:
|
||||
~QFileInfo();
|
||||
|
||||
QFileInfo &operator=(const QFileInfo &fileinfo);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QFileInfo &operator=(QFileInfo &&other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
|
||||
void swap(QFileInfo &other) noexcept
|
||||
{ qSwap(d_ptr, other.d_ptr); }
|
||||
|
@ -72,9 +72,7 @@ public:
|
||||
QProcessEnvironment();
|
||||
QProcessEnvironment(const QProcessEnvironment &other);
|
||||
~QProcessEnvironment();
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QProcessEnvironment &operator=(QProcessEnvironment && other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
QProcessEnvironment &operator=(const QProcessEnvironment &other);
|
||||
|
||||
void swap(QProcessEnvironment &other) noexcept { qSwap(d, other.d); }
|
||||
|
@ -62,9 +62,7 @@ public:
|
||||
~QStorageInfo();
|
||||
|
||||
QStorageInfo &operator=(const QStorageInfo &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QStorageInfo &operator=(QStorageInfo &&other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
|
||||
inline void swap(QStorageInfo &other) noexcept
|
||||
{ qSwap(d, other.d); }
|
||||
|
@ -182,12 +182,10 @@ public:
|
||||
QUrl(const QString &url, ParsingMode mode = TolerantMode);
|
||||
QUrl &operator=(const QString &url);
|
||||
#endif
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QUrl(QUrl &&other) noexcept : d(other.d)
|
||||
{ other.d = nullptr; }
|
||||
inline QUrl &operator=(QUrl &&other) noexcept
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
~QUrl();
|
||||
|
||||
inline void swap(QUrl &other) noexcept { qSwap(d, other.d); }
|
||||
|
@ -70,9 +70,7 @@ public:
|
||||
|
||||
QUrlQuery(const QUrlQuery &other);
|
||||
QUrlQuery &operator=(const QUrlQuery &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QUrlQuery &operator=(QUrlQuery &&other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
~QUrlQuery();
|
||||
|
||||
bool operator==(const QUrlQuery &other) const;
|
||||
|
@ -117,12 +117,10 @@ public:
|
||||
inline bool operator!=(const QPersistentModelIndex &other) const
|
||||
{ return !operator==(other); }
|
||||
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QPersistentModelIndex(QPersistentModelIndex &&other) noexcept
|
||||
: d(other.d) { other.d = nullptr; }
|
||||
inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) noexcept
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
inline void swap(QPersistentModelIndex &other) noexcept { qSwap(d, other.d); }
|
||||
bool operator==(const QModelIndex &other) const;
|
||||
bool operator!=(const QModelIndex &other) const;
|
||||
|
@ -60,12 +60,10 @@ public:
|
||||
// ### Qt 6: remove them all, the compiler-generated ones are fine
|
||||
inline QItemSelectionRange(const QItemSelectionRange &other)
|
||||
: tl(other.tl), br(other.br) {}
|
||||
# ifdef Q_COMPILER_RVALUE_REFS
|
||||
QItemSelectionRange(QItemSelectionRange &&other) noexcept
|
||||
: tl(std::move(other.tl)), br(std::move(other.br)) {}
|
||||
QItemSelectionRange &operator=(QItemSelectionRange &&other) noexcept
|
||||
{ tl = std::move(other.tl); br = std::move(other.br); return *this; }
|
||||
# endif
|
||||
QItemSelectionRange &operator=(const QItemSelectionRange &other)
|
||||
{ tl = other.tl; br = other.br; return *this; }
|
||||
#endif // Qt < 6
|
||||
|
@ -544,10 +544,8 @@ public:
|
||||
inline explicit QSignalBlocker(QObject &o) noexcept;
|
||||
inline ~QSignalBlocker();
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QSignalBlocker(QSignalBlocker &&other) noexcept;
|
||||
inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept;
|
||||
#endif
|
||||
|
||||
inline void reblock() noexcept;
|
||||
inline void unblock() noexcept;
|
||||
@ -570,7 +568,6 @@ QSignalBlocker::QSignalBlocker(QObject &o) noexcept
|
||||
m_inhibited(false)
|
||||
{}
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept
|
||||
: m_o(other.m_o),
|
||||
m_blocked(other.m_blocked),
|
||||
@ -594,7 +591,6 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) noexcept
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
QSignalBlocker::~QSignalBlocker()
|
||||
{
|
||||
|
@ -145,7 +145,6 @@ QPpsAttribute &QPpsAttribute::operator=(const QPpsAttribute &other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QPpsAttribute::QPpsAttribute(QPpsAttribute &&other) : d(other.d)
|
||||
{
|
||||
other.d->type = QPpsAttribute::None;
|
||||
@ -156,7 +155,6 @@ QPpsAttribute &QPpsAttribute::operator=(QPpsAttribute &&other)
|
||||
qSwap(d, other.d);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool QPpsAttribute::operator==(const QPpsAttribute &other) const
|
||||
{
|
||||
|
@ -96,10 +96,8 @@ public:
|
||||
bool operator==(const QPpsAttribute &other) const;
|
||||
bool operator!=(const QPpsAttribute &other) const;
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QPpsAttribute(QPpsAttribute &&other);
|
||||
QPpsAttribute &operator=(QPpsAttribute &&other);
|
||||
#endif
|
||||
|
||||
bool isValid() const;
|
||||
Type type() const;
|
||||
|
@ -267,12 +267,10 @@ class Q_CORE_EXPORT QVariant
|
||||
#endif
|
||||
|
||||
QVariant& operator=(const QVariant &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QVariant(QVariant &&other) noexcept : d(other.d)
|
||||
{ other.d = Private(); }
|
||||
inline QVariant &operator=(QVariant &&other) noexcept
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
|
||||
inline void swap(QVariant &other) noexcept { qSwap(d, other.d); }
|
||||
|
||||
|
@ -78,9 +78,7 @@ public:
|
||||
QMimeType();
|
||||
QMimeType(const QMimeType &other);
|
||||
QMimeType &operator=(const QMimeType &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QMimeType &operator=(QMimeType &&other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
void swap(QMimeType &other) noexcept
|
||||
{
|
||||
qSwap(d, other.d);
|
||||
|
@ -103,7 +103,6 @@ QT_END_NAMESPACE
|
||||
} \
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#define QMIMETYPE_BUILDER_FROM_RVALUE_REFS \
|
||||
QT_BEGIN_NAMESPACE \
|
||||
static QMimeType buildQMimeType ( \
|
||||
@ -122,6 +121,5 @@ QT_END_NAMESPACE
|
||||
return QMimeType(qMimeTypeData); \
|
||||
} \
|
||||
QT_END_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif // QMIMETYPE_P_H
|
||||
|
@ -59,19 +59,15 @@ public:
|
||||
inline QXmlStreamStringRef(const QStringRef &aString)
|
||||
: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()) {}
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
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)
|
||||
QXmlStreamStringRef(const QXmlStreamStringRef &other) // = default
|
||||
: 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
|
||||
: m_string(std::move(other.m_string)), m_position(other.m_position), m_size(other.m_size) {}
|
||||
QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) noexcept // = default
|
||||
{ swap(other); return *this; }
|
||||
#endif
|
||||
QXmlStreamStringRef &operator=(const QXmlStreamStringRef &other) // = default
|
||||
{ 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,
|
||||
@ -111,7 +107,6 @@ public:
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value);
|
||||
QXmlStreamAttribute(const QXmlStreamAttribute &);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QXmlStreamAttribute(QXmlStreamAttribute &&other) noexcept // = default;
|
||||
: m_name(std::move(other.m_name)),
|
||||
m_namespaceUri(std::move(other.m_namespaceUri)),
|
||||
@ -132,7 +127,6 @@ public:
|
||||
m_isDefault = other.m_isDefault;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
QXmlStreamAttribute& operator=(const QXmlStreamAttribute &);
|
||||
~QXmlStreamAttribute();
|
||||
#endif // < Qt 6
|
||||
|
@ -82,7 +82,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QArrayDataPointer(QArrayDataPointer &&other) noexcept
|
||||
: d(other.d)
|
||||
{
|
||||
@ -95,7 +94,6 @@ public:
|
||||
this->swap(moved);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
DataOps &operator*() const
|
||||
{
|
||||
|
@ -58,11 +58,9 @@ public:
|
||||
explicit QBitArray(int size, bool val = false);
|
||||
QBitArray(const QBitArray &other) : d(other.d) {}
|
||||
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 &operator=(QBitArray &&other) noexcept
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
|
||||
inline void swap(QBitArray &other) noexcept { qSwap(d, other.d); }
|
||||
|
||||
|
@ -177,11 +177,9 @@ public:
|
||||
|
||||
QByteArray &operator=(const QByteArray &) noexcept;
|
||||
QByteArray &operator=(const char *str);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QByteArray(QByteArray && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
|
||||
inline QByteArray &operator=(QByteArray &&other) noexcept
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
|
||||
inline void swap(QByteArray &other) noexcept
|
||||
{ qSwap(d, other.d); }
|
||||
|
@ -57,10 +57,8 @@ public:
|
||||
QCollatorSortKey(const QCollatorSortKey &other);
|
||||
~QCollatorSortKey();
|
||||
QCollatorSortKey &operator=(const QCollatorSortKey &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QCollatorSortKey &operator=(QCollatorSortKey &&other) noexcept
|
||||
{ swap(other); return *this; }
|
||||
#endif
|
||||
void swap(QCollatorSortKey &other) noexcept
|
||||
{ d.swap(other.d); }
|
||||
|
||||
@ -87,12 +85,10 @@ public:
|
||||
QCollator(const QCollator &);
|
||||
~QCollator();
|
||||
QCollator &operator=(const QCollator &);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QCollator(QCollator &&other) noexcept
|
||||
: d(other.d) { other.d = nullptr; }
|
||||
QCollator &operator=(QCollator &&other) noexcept
|
||||
{ swap(other); return *this; }
|
||||
#endif
|
||||
|
||||
void swap(QCollator &other) noexcept
|
||||
{ qSwap(d, other.d); }
|
||||
|
@ -71,9 +71,7 @@ public:
|
||||
~QCommandLineOption();
|
||||
|
||||
QCommandLineOption &operator=(const QCommandLineOption &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
QCommandLineOption &operator=(QCommandLineOption &&other) noexcept { swap(other); return *this; }
|
||||
#endif
|
||||
|
||||
void swap(QCommandLineOption &other) noexcept
|
||||
{ qSwap(d, other.d); }
|
||||
|
@ -107,10 +107,8 @@ public:
|
||||
#endif
|
||||
|
||||
QContiguousCache<T> &operator=(const QContiguousCache<T> &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
inline QContiguousCache<T> &operator=(QContiguousCache<T> &&other)
|
||||
{ qSwap(d, other.d); return *this; }
|
||||
#endif
|
||||
inline void swap(QContiguousCache<T> &other) { qSwap(d, other.d); }
|
||||
bool operator==(const QContiguousCache<T> &other) const;
|
||||
inline bool operator!=(const QContiguousCache<T> &other) const { return !(*this == other); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user