diff options
| author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-16 17:08:36 +0200 |
|---|---|---|
| committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-20 09:32:22 +0200 |
| commit | 3c74ba1f8b1052e684c67cbbb6f99eb4f7146f40 (patch) | |
| tree | 1752893be9fae5889c42657e045d73d9d3773664 /src/corelib/kernel/qmetaobjectbuilder.cpp | |
| parent | 5683c0afdaf942e81ba614bd44eda0cc59d0d7a1 (diff) | |
QList::removeAll: make it generic
This is a bit more tricky than expected because we support passing
references to objects that are into the list itself (for instance,
list.removeAll(list.front())). For those objects we have to take
copies. This is fine, but the moment we make the function generic,
that's going to fail when passing arguments of types that cannot
be copied, such as arrays (e.g. stringList.removeAll("hello")).
For those, keep a reference, as they cannot be aliases into the
list anyhow.
[ChangeLog][QtCore][QList] The removeAll and removeOne methods
now take an object of any datatype -- and not just the
list's own value type. This allows for heterogenous removal inside
QLists.
Change-Id: I0c447770bbc7ff0ff4bb4c0e35081414c5ff963e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobjectbuilder.cpp')
0 files changed, 0 insertions, 0 deletions
