mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 20:03:02 +08:00
Introduce vcpkg_Maps utility namespace
This commit is contained in:
parent
c699d5715b
commit
addecbfdef
18
toolsrc/include/vcpkg_Maps.h
Normal file
18
toolsrc/include/vcpkg_Maps.h
Normal 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;
|
||||
}
|
||||
}}
|
@ -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" />
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user