diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-12 22:12:37 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-12 22:40:17 -0700 |
| commit | 8972bd3067f363c055e29ad66254b04513d1df65 (patch) | |
| tree | eb4783e4b75496a6249bc0549829f80aefb3dc63 /toolsrc/include | |
| parent | e78827e8cc5c0c75efd8c2c687fc007a922b69a3 (diff) | |
| download | vcpkg-8972bd3067f363c055e29ad66254b04513d1df65.tar.gz vcpkg-8972bd3067f363c055e29ad66254b04513d1df65.zip | |
Introduce keep_if function
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index 4ebb2a802..fedf93c7a 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -21,4 +21,10 @@ namespace vcpkg::Util return ret; } + + template<class Container, class Pred> + void keep_if(Container& cont, Pred pred) + { + cont.erase(std::remove_if(cont.begin(), cont.end(), pred), cont.end()); + } }
\ No newline at end of file |
