Make Q(Multi)Map equality operators documentation-friendly
Change-Id: I1a84c437bb19dd3c667596c59e1404bbbf39978e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
parent
cbefd42e39
commit
aa38ab8f68
@ -272,12 +272,18 @@ public:
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_QDOC
|
||||||
|
template <typename AKey, typename AT>
|
||||||
|
friend bool operator==(const QMap<AKey, AT> &lhs, const QMap<AKey, AT> &rhs);
|
||||||
|
template <typename AKey, typename AT>
|
||||||
|
friend bool operator!=(const QMap<AKey, AT> &lhs, const QMap<AKey, AT> &rhs);
|
||||||
|
#else
|
||||||
// CHANGE: non-member equality comparison
|
// CHANGE: non-member equality comparison
|
||||||
template <typename AKey, typename AT>
|
template <typename AKey, typename AT>
|
||||||
friend QTypeTraits::compare_eq_result<AKey, AT> operator==(const QMap<AKey, AT> &lhs, const QMap<AKey, AT> &rhs);
|
friend QTypeTraits::compare_eq_result<AKey, AT> operator==(const QMap<AKey, AT> &lhs, const QMap<AKey, AT> &rhs);
|
||||||
template <typename AKey, typename AT>
|
template <typename AKey, typename AT>
|
||||||
friend QTypeTraits::compare_eq_result<AKey, AT> operator!=(const QMap<AKey, AT> &lhs, const QMap<AKey, AT> &rhs);
|
friend QTypeTraits::compare_eq_result<AKey, AT> operator!=(const QMap<AKey, AT> &lhs, const QMap<AKey, AT> &rhs);
|
||||||
|
#endif
|
||||||
// TODO: add the other comparison operators; std::map has them.
|
// TODO: add the other comparison operators; std::map has them.
|
||||||
|
|
||||||
size_type size() const { return d ? size_type(d->m.size()) : size_type(0); }
|
size_type size() const { return d ? size_type(d->m.size()) : size_type(0); }
|
||||||
@ -842,11 +848,18 @@ public:
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_QDOC
|
||||||
|
template <typename AKey, typename AT>
|
||||||
|
friend bool operator==(const QMultiMap<AKey, AT> &lhs, const QMultiMap<AKey, AT> &rhs);
|
||||||
|
template <typename AKey, typename AT>
|
||||||
|
friend bool operator!=(const QMultiMap<AKey, AT> &lhs, const QMultiMap<AKey, AT> &rhs);
|
||||||
|
#else
|
||||||
// CHANGE: non-member equality comparison
|
// CHANGE: non-member equality comparison
|
||||||
template <typename AKey, typename AT>
|
template <typename AKey, typename AT>
|
||||||
friend QTypeTraits::compare_eq_result<AKey, AT> operator==(const QMultiMap<AKey, AT> &lhs, const QMultiMap<AKey, AT> &rhs);
|
friend QTypeTraits::compare_eq_result<AKey, AT> operator==(const QMultiMap<AKey, AT> &lhs, const QMultiMap<AKey, AT> &rhs);
|
||||||
template <typename AKey, typename AT>
|
template <typename AKey, typename AT>
|
||||||
friend QTypeTraits::compare_eq_result<AKey, AT> operator!=(const QMultiMap<AKey, AT> &lhs, const QMultiMap<AKey, AT> &rhs);
|
friend QTypeTraits::compare_eq_result<AKey, AT> operator!=(const QMultiMap<AKey, AT> &lhs, const QMultiMap<AKey, AT> &rhs);
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: add the other comparison operators; std::multimap has them.
|
// TODO: add the other comparison operators; std::multimap has them.
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@
|
|||||||
Returns an STL map equivalent to this QMap.
|
Returns an STL map equivalent to this QMap.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn template <class Key, class T> bool operator==(const QMap<Key, T> &lhs, const QMap<Key, T> &rhs) const
|
/*! \fn template <class Key, class T> bool operator==(const QMap<Key, T> &lhs, const QMap<Key, T> &rhs)
|
||||||
\relates QMap
|
\relates QMap
|
||||||
|
|
||||||
Returns \c true if \a lhs is equal to \a rhs; otherwise returns
|
Returns \c true if \a lhs is equal to \a rhs; otherwise returns
|
||||||
@ -264,7 +264,7 @@
|
|||||||
\sa operator!=()
|
\sa operator!=()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn template <class Key, class T> bool operator!=(const QMap<Key, T> &lhs, const QMap<Key, T> &rhs) const
|
/*! \fn template <class Key, class T> bool operator!=(const QMap<Key, T> &lhs, const QMap<Key, T> &rhs)
|
||||||
\relates QMap
|
\relates QMap
|
||||||
|
|
||||||
Returns \c true if \a lhs is not equal to \a rhs; otherwise returns
|
Returns \c true if \a lhs is not equal to \a rhs; otherwise returns
|
||||||
|
Loading…
x
Reference in New Issue
Block a user