fixes #114 incorrect iterator increment in for loop in CContainerBase::removeIf

This commit is contained in:
Mathew Sutcliffe
2014-02-02 16:34:17 +00:00
parent bb4fe3f858
commit f8780d0075

View File

@@ -132,9 +132,10 @@ namespace BlackMisc
template <class Predicate>
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); }
else { ++it; }
}
}