summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetacontainer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qmetacontainer.h')
-rw-r--r--src/corelib/kernel/qmetacontainer.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/corelib/kernel/qmetacontainer.h b/src/corelib/kernel/qmetacontainer.h
index 68d62bd2ea..1bed7f9f7b 100644
--- a/src/corelib/kernel/qmetacontainer.h
+++ b/src/corelib/kernel/qmetacontainer.h
@@ -5,9 +5,12 @@
#define QMETACONTAINER_H
#include <QtCore/qcontainerinfo.h>
+#include <QtCore/qcompare.h>
#include <QtCore/qflags.h>
#include <QtCore/qglobal.h>
+#include <iterator>
+
QT_BEGIN_NAMESPACE
class QMetaType;
@@ -973,16 +976,15 @@ public:
bool canGetValueAtConstIterator() const;
void valueAtConstIterator(const void *iterator, void *result) const;
- friend bool operator==(const QMetaSequence &a, const QMetaSequence &b)
- {
- return a.d() == b.d();
- }
- friend bool operator!=(const QMetaSequence &a, const QMetaSequence &b)
+ const QtMetaContainerPrivate::QMetaSequenceInterface *iface() const { return d(); }
+
+private:
+ friend bool comparesEqual(const QMetaSequence &lhs, const QMetaSequence &rhs) noexcept
{
- return a.d() != b.d();
+ return lhs.d() == rhs.d();
}
+ Q_DECLARE_EQUALITY_COMPARABLE(QMetaSequence)
-private:
template<typename T>
struct MetaSequence
{
@@ -1167,16 +1169,15 @@ public:
return nullptr;
}
- friend bool operator==(const QMetaAssociation &a, const QMetaAssociation &b)
- {
- return a.d() == b.d();
- }
- friend bool operator!=(const QMetaAssociation &a, const QMetaAssociation &b)
+ const QtMetaContainerPrivate::QMetaAssociationInterface *iface() const { return d(); }
+
+private:
+ friend bool comparesEqual(const QMetaAssociation &lhs, const QMetaAssociation &rhs) noexcept
{
- return a.d() != b.d();
+ return lhs.d() == rhs.d();
}
+ Q_DECLARE_EQUALITY_COMPARABLE(QMetaAssociation)
-private:
template<typename T>
struct MetaAssociation
{