Introduce vcpkg_Maps utility namespace

This commit is contained in:
Alexander Karatarakis 2016-09-22 23:28:14 -07:00
parent c699d5715b
commit addecbfdef
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#pragma once
#include <unordered_map>
#include <unordered_set>
namespace vcpkg { namespace Maps
{
template <typename K, typename V>
std::unordered_set<K> extract_key_set(const std::unordered_map<K, V>& input_map)
{
std::unordered_set<K> key_set;
for (auto const& element : input_map)
{
key_set.insert(element.first);
}
return key_set;
}
}}

View File

@ -131,6 +131,7 @@
<ClInclude Include="..\include\vcpkg_Checks.h" />
<ClInclude Include="..\include\vcpkg_Files.h" />
<ClInclude Include="..\include\vcpkg_Graphs.h" />
<ClInclude Include="..\include\vcpkg_Maps.h" />
<ClInclude Include="..\include\vcpkg_Sets.h" />
<ClInclude Include="..\include\vcpkg_Strings.h" />
<ClInclude Include="..\include\vcpkg_System.h" />

View File

@ -50,6 +50,9 @@
<ClInclude Include="..\include\opt_bool.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vcpkg_Maps.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\vcpkg_Sets.h">
<Filter>Header Files</Filter>
</ClInclude>