Introduce Util::stable_keep_if()

This commit is contained in:
Alexander Karatarakis 2017-10-04 15:50:48 -07:00
parent 68a9876682
commit 7f68aa6630

View File

@ -37,6 +37,12 @@ namespace vcpkg::Util
return ret;
}
template<class Container, class Pred>
void stable_keep_if(Container& cont, Pred pred)
{
cont.erase(std::stable_partition(cont.begin(), cont.end(), pred), cont.end());
}
template<class Container, class Pred>
void unstable_keep_if(Container& cont, Pred pred)
{