diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-13 17:53:09 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-14 14:31:45 -0700 |
| commit | 66017aa2c3873c95da863077b184529c96c299b8 (patch) | |
| tree | 4342a8dff13b1dab52ba55e61e62569c0c98c5a6 /toolsrc/include | |
| parent | e3f4e09342179b6d911ada5a02b2a2b207790552 (diff) | |
| download | vcpkg-66017aa2c3873c95da863077b184529c96c299b8.tar.gz vcpkg-66017aa2c3873c95da863077b184529c96c299b8.zip | |
Add Util::find_if() and Util::find_if_not()
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index 06cac21ad..bb93413ed 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -27,4 +27,16 @@ namespace vcpkg::Util { 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); + } }
\ No newline at end of file |
