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>
This commit is contained in:
Giuseppe D'Angelo 2020-10-25 18:34:13 +01:00
parent e2e9ce8109
commit 1aa3459d0a
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -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.