QList::removeOne: make it generic as well

Change-Id: I0c50b2ae76f9d0f053b3d5b1ab98d12e0524e419
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2020-10-16 16:55:49 +02:00
parent 3c74ba1f8b
commit 141fae112a
2 changed files with 3 additions and 2 deletions

View File

@ -340,7 +340,8 @@ public:
erase(it, e);
return result;
}
bool removeOne(const T &t)
template <typename AT>
bool removeOne(const AT &t)
{
const qsizetype i = indexOf(t);
if (i < 0)

View File

@ -845,7 +845,7 @@
\sa removeOne()
*/
/*! \fn template <typename T> bool QList<T>::removeOne(const T &t)
/*! \fn template <typename T> template <typename AT> bool QList<T>::removeOne(const AT &t)
\since 5.4
Removes the first element that compares equal to \a t from the