diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-06 20:11:50 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-06 20:11:50 -0800 |
| commit | 83ffbf028f8a77bfab23328aa8f2280db5539329 (patch) | |
| tree | c1a9a3dae0f672fffb6b0c66724150053057b90c /toolsrc | |
| parent | 6e9eafb7ed6a841e3c8eff8e3a674037a9f30f26 (diff) | |
| download | vcpkg-83ffbf028f8a77bfab23328aa8f2280db5539329.tar.gz vcpkg-83ffbf028f8a77bfab23328aa8f2280db5539329.zip | |
[Maps] Add overload for map (existing: unordered_map)
Diffstat (limited to 'toolsrc')
| -rw-r--r-- | toolsrc/include/vcpkg_Maps.h | 12 |
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; + } }} |
