mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-06 12:03:39 +00:00
14 lines
340 B
C++
14 lines
340 B
C++
#pragma once
|
|
#include <map>
|
|
#include <functional>
|
|
|
|
template <typename ContainerT, typename PredicateT>
|
|
void erase_if(ContainerT& items, const PredicateT& predicate) {
|
|
for (auto it = items.begin(); it != items.end();) {
|
|
if (predicate(*it)) {
|
|
it = items.erase(it);
|
|
} else {
|
|
++it;
|
|
}
|
|
}
|
|
}; |