mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 03:34:26 +08:00
Add Util::find_if() and Util::find_if_not()
This commit is contained in:
parent
e3f4e09342
commit
66017aa2c3
@ -27,4 +27,16 @@ namespace vcpkg::Util
|
|||||||
{
|
{
|
||||||
cont.erase(std::remove_if(cont.begin(), cont.end(), pred), cont.end());
|
cont.erase(std::remove_if(cont.begin(), cont.end(), pred), cont.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Container, class Pred>
|
||||||
|
auto find_if(const Container& cont, Pred pred)
|
||||||
|
{
|
||||||
|
return std::find_if(cont.cbegin(), cont.cend(), pred);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class Container, class Pred>
|
||||||
|
auto find_if_not(const Container& cont, Pred pred)
|
||||||
|
{
|
||||||
|
return std::find_if_not(cont.cbegin(), cont.cend(), pred);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user