aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-11-06 20:11:50 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2016-11-06 20:11:50 -0800
commit83ffbf028f8a77bfab23328aa8f2280db5539329 (patch)
treec1a9a3dae0f672fffb6b0c66724150053057b90c
parent6e9eafb7ed6a841e3c8eff8e3a674037a9f30f26 (diff)
downloadvcpkg-83ffbf028f8a77bfab23328aa8f2280db5539329.tar.gz
vcpkg-83ffbf028f8a77bfab23328aa8f2280db5539329.zip
[Maps] Add overload for map (existing: unordered_map)
-rw-r--r--toolsrc/include/vcpkg_Maps.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h
index 886889294..c67462a39 100644
--- a/toolsrc/include/vcpkg_Maps.h
+++ b/toolsrc/include/vcpkg_Maps.h
@@ -2,6 +2,7 @@
#include <unordered_map>
#include <unordered_set>
+#include <map>
namespace vcpkg { namespace Maps
{
@@ -26,4 +27,15 @@ namespace vcpkg { namespace Maps
}
return key_set;
}
+
+ template <typename K, typename V>
+ std::vector<K> extract_keys(const std::map<K, V>& input_map)
+ {
+ std::vector<K> key_set;
+ for (auto const& element : input_map)
+ {
+ key_set.push_back(element.first);
+ }
+ return key_set;
+ }
}}