diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-16 16:55:49 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-20 09:32:24 +0200 |
commit | 141fae112abc7c7deb0d839ddf351a34f79c646b (patch) | |
tree | 174c28978f3a266e81b6b2f8772cc5280bbef1e2 /src/corelib | |
parent | 3c74ba1f8b1052e684c67cbbb6f99eb4f7146f40 (diff) |
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>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qlist.h | 3 | ||||
-rw-r--r-- | src/corelib/tools/qlist.qdoc | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 3094bcba97..e9fb664da1 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -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) diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc index 916715ddb8..8ec9b22863 100644 --- a/src/corelib/tools/qlist.qdoc +++ b/src/corelib/tools/qlist.qdoc @@ -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 |