diff options
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetatype.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/abstractmetatype.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetatype.h b/sources/shiboken6/ApiExtractor/abstractmetatype.h index bbc266231..8a1ecdf20 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetatype.h +++ b/sources/shiboken6/ApiExtractor/abstractmetatype.h @@ -9,7 +9,9 @@ #include "parser/codemodel_enums.h" #include "typedatabase_typedefs.h" +#include <QtCore/QtCompare> #include <QtCore/qobjectdefs.h> +#include <QtCore/QHashFunctions> #include <QtCore/QSharedDataPointer> #include <QtCore/QList> #include <QtCore/QSet> @@ -50,8 +52,8 @@ public: explicit AbstractMetaType(const TypeEntryCPtr &t); AbstractMetaType(const AbstractMetaType &); AbstractMetaType &operator=(const AbstractMetaType &); - AbstractMetaType(AbstractMetaType &&); - AbstractMetaType &operator=(AbstractMetaType &&); + AbstractMetaType(AbstractMetaType &&) noexcept; + AbstractMetaType &operator=(AbstractMetaType &&) noexcept; ~AbstractMetaType(); QString package() const; @@ -119,6 +121,7 @@ public: bool passByConstRef() const; bool passByValue() const; + bool useStdMove() const; ReferenceType referenceType() const; void setReferenceType(ReferenceType ref); @@ -169,7 +172,6 @@ public: bool hasTemplateChildren() const; - bool equals(const AbstractMetaType &rhs) const; /// Is equivalent from the POV of argument passing (differ by const ref) bool isEquivalent(const AbstractMetaType &rhs) const; @@ -186,7 +188,7 @@ public: /// \param typeSignature The string describing the type to be built. /// \return A new AbstractMetaType object or nullopt in case of failure. static std::optional<AbstractMetaType> - fromString(QString typeSignature, QString *errorMessage = nullptr); + fromString(const QString &typeSignatureIn, QString *errorMessage = nullptr); /// Creates an AbstractMetaType object from a TypeEntry. static AbstractMetaType fromTypeEntry(const TypeEntryCPtr &typeEntry); /// Creates an AbstractMetaType object from an AbstractMetaClass. @@ -252,6 +254,12 @@ public: #endif private: + friend size_t qHash(const AbstractMetaType &t, size_t seed = 0) noexcept + { return qHash(t.typeEntry().get(), seed); } + friend bool comparesEqual(const AbstractMetaType &lhs, + const AbstractMetaType &rhs) noexcept; + Q_DECLARE_EQUALITY_COMPARABLE(AbstractMetaType) + friend class AbstractMetaTypeData; QSharedDataPointer<AbstractMetaTypeData> d; @@ -260,14 +268,6 @@ private: QString formatPythonSignature() const; }; -inline bool operator==(const AbstractMetaType &t1, const AbstractMetaType &t2) -{ return t1.equals(t2); } -inline bool operator!=(const AbstractMetaType &t1, const AbstractMetaType &t2) -{ return !t1.equals(t2); } - -inline size_t qHash(const AbstractMetaType &t, size_t seed) -{ return qHash(t.typeEntry().get(), seed); } - #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug d, const AbstractMetaType &at); QDebug operator<<(QDebug d, const AbstractMetaType *at); |