mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
fixes #114 incorrect iterator increment in for loop in CContainerBase::removeIf
This commit is contained in:
@@ -132,9 +132,10 @@ namespace BlackMisc
|
|||||||
template <class Predicate>
|
template <class Predicate>
|
||||||
void removeIf(Predicate p)
|
void removeIf(Predicate p)
|
||||||
{
|
{
|
||||||
for (auto it = derived().begin(); it != derived().end(); ++it)
|
for (auto it = derived().begin(); it != derived().end(); )
|
||||||
{
|
{
|
||||||
if (p(*it)) { it = derived().erase(it); }
|
if (p(*it)) { it = derived().erase(it); }
|
||||||
|
else { ++it; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user