diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-02 19:33:11 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-02 19:33:11 -0700 |
| commit | 8a97f05d92a34589e1cf87865d0e0b5394ac05b3 (patch) | |
| tree | 8989047b326a2ab5467b7512c02adbbbb5d9f7b7 | |
| parent | 1fa055569540d887ceca0daadca7d0160b886089 (diff) | |
| download | vcpkg-8a97f05d92a34589e1cf87865d0e0b5394ac05b3.tar.gz vcpkg-8a97f05d92a34589e1cf87865d0e0b5394ac05b3.zip | |
[Maps] Add function extract_keys()
| -rw-r--r-- | toolsrc/include/vcpkg_Maps.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index 5b7b8ed46..886889294 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -15,4 +15,15 @@ namespace vcpkg { namespace Maps } return key_set; } + + template <typename K, typename V> + std::vector<K> extract_keys(const std::unordered_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; + } }} |
