summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmap.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2021-10-08 18:06:49 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2021-10-18 13:42:07 +0200
commit8a8bf1b84e9a096993b892873eb62c735149f320 (patch)
tree3993d9c3998d3471197b747eca7f50d1c45e1ea9 /src/corelib/tools/qmap.h
parent2f2fdc418d88dbb2b7e8dbf574d51286354067a7 (diff)
Fix docs for comparison/debug/data stream operators of Qt containers
Because of the constraints on comparison, debug and data stream operators, the return types for them look weird in docs. Conditionally use the actual return types, in case if Q_CLANG_QDOC is defined. Also add the docs of debug stream operators for types for which they were misssing. Task-number: QTBUG-97247 Pick-to: 6.2 Change-Id: I57f2c52bd3af805c7eeebb602c47de1e95ee09bd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r--src/corelib/tools/qmap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index b2053127fe..7fd6e4d705 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -276,6 +276,7 @@ public:
return {};
}
+#ifndef Q_CLANG_QDOC
template <typename AKey = Key, typename AT = T> friend
QTypeTraits::compare_eq_result_container<QMap, AKey, AT> operator==(const QMap &lhs, const QMap &rhs)
{
@@ -293,6 +294,10 @@ public:
return !(lhs == rhs);
}
// TODO: add the other comparison operators; std::map has them.
+#else
+ friend bool operator==(const QMap &lhs, const QMap &rhs);
+ friend bool operator!=(const QMap &lhs, const QMap &rhs);
+#endif // Q_CLANG_QDOC
size_type size() const { return d ? size_type(d->m.size()) : size_type(0); }
@@ -904,6 +909,7 @@ public:
return {};
}
+#ifndef Q_CLANG_QDOC
template <typename AKey = Key, typename AT = T> friend
QTypeTraits::compare_eq_result_container<QMultiMap, AKey, AT> operator==(const QMultiMap &lhs, const QMultiMap &rhs)
{
@@ -921,6 +927,10 @@ public:
return !(lhs == rhs);
}
// TODO: add the other comparison operators; std::multimap has them.
+#else
+ friend bool operator==(const QMultiMap &lhs, const QMultiMap &rhs);
+ friend bool operator!=(const QMultiMap &lhs, const QMultiMap &rhs);
+#endif // Q_CLANG_QDOC
size_type size() const { return d ? size_type(d->m.size()) : size_type(0); }