diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-25 18:34:13 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-26 14:18:12 +0100 |
commit | 1aa3459d0a534473582806b0988d26533bc7e16a (patch) | |
tree | 42fe7c3ef1cb14c8bb38c8382b1df7f4406c5d26 /src | |
parent | e2e9ce8109b6293a6a3eceb81c48b6d4aabfc99d (diff) | |
download | qtbase-1aa3459d0a534473582806b0988d26533bc7e16a.tar.gz |
QList: also default count()'s template parameter
Also fix the docs.
Change-Id: If08116cb8657d00d610de9451be0ba73ce19dcd1
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qlist.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qlist.qdoc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 7ec62f33e5..58676eeb1f 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -352,7 +352,7 @@ public: bool contains(const AT &t) const noexcept; #endif - template <typename AT> + template <typename AT = T> qsizetype count(const AT &t) const noexcept { return qsizetype(std::count(&*cbegin(), &*cend(), t)); diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc index 1da4239d10..a6c011b2bf 100644 --- a/src/corelib/tools/qlist.qdoc +++ b/src/corelib/tools/qlist.qdoc @@ -1013,7 +1013,7 @@ */ -/*! \fn template <typename T> qsizetype QList<T>::count(parameter_type value) const +/*! \fn template <typename T> template <typename AT = T> qsizetype QList<T>::count(const AT &value) const Returns the number of occurrences of \a value in the list. |