diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-22 23:27:46 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-22 23:27:46 -0700 |
| commit | c699d5715b2e768ef2f7742a1894742df982038b (patch) | |
| tree | ec63b234f2ee73edddaa128346e48ae99a9c7d44 /toolsrc/include | |
| parent | d2e3779cf203d209942fa347b50da1c16106a77a (diff) | |
| download | vcpkg-c699d5715b2e768ef2f7742a1894742df982038b.tar.gz vcpkg-c699d5715b2e768ef2f7742a1894742df982038b.zip | |
Introduce vcpkg::Sets utility namespace
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Sets.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h new file mode 100644 index 000000000..7b330f31c --- /dev/null +++ b/toolsrc/include/vcpkg_Sets.h @@ -0,0 +1,17 @@ +#pragma once + +#include "vcpkg_Checks.h" +#include <unordered_set> + +namespace vcpkg { namespace Sets +{ + template <typename T, typename Container> + void remove_all(std::unordered_set<T>* input_set, Container remove_these) + { + Checks::check_throw(input_set != nullptr, "Input set cannot be null"); + for (const T& r : remove_these) + { + input_set->erase(r); + } + } +}} |
