summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qset.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2021-09-01 15:33:13 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2021-09-07 15:48:35 +0200
commit9f13842fe61541cb8ab9822174ea963e418b5537 (patch)
tree0a377443905a961cfcde23e3816d4b2dd6ebf7dc /src/corelib/tools/qset.h
parent4cde0e484c009415397430050cde389fb9b445b6 (diff)
Fix compilation for recursive Qt containers
The operator checks cause compilation errors when trying to check for their existence for recursive containers. This happens because of trying to check for the operators on the template parameter type(s), that inherit from the container itself, which leads to compilation errors. Introduced alternative versions of the operator checks (with _container suffix), that first check if the container is recursive, i.e. any of its template parameter types inherits from the given container, and skips the operator check, if that's the case. The fix is done for all Qt container types that had the problem, except for QVarLengthArray and QContiguousCache, which don't compile with recursive parameter types for unrelated reasons. Fixes: QTBUG-91707 Pick-to: 6.2 6.1 Change-Id: Ia1e7240b4ce240c1c44f00ca680717d182df7550 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/tools/qset.h')
-rw-r--r--src/corelib/tools/qset.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index 681ce9cbe2..565b8b5691 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -72,10 +72,10 @@ public:
inline void swap(QSet<T> &other) noexcept { q_hash.swap(other.q_hash); }
template <typename U = T>
- QTypeTraits::compare_eq_result<U> operator==(const QSet<T> &other) const
+ QTypeTraits::compare_eq_result_container<QSet, U> operator==(const QSet<T> &other) const
{ return q_hash == other.q_hash; }
template <typename U = T>
- QTypeTraits::compare_eq_result<U> operator!=(const QSet<T> &other) const
+ QTypeTraits::compare_eq_result_container<QSet, U> operator!=(const QSet<T> &other) const
{ return q_hash != other.q_hash; }
inline qsizetype size() const { return q_hash.size(); }