mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-10 17:39:31 +08:00
31 lines
681 B
C++
31 lines
681 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
|
|
namespace vcpkg::Maps
|
|
{
|
|
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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|