From 69dfad795f4ffb5bec60602ec1116730027ff088 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 14 Mar 2018 16:48:18 -0700 Subject: Introduce Maps::transform_values() --- toolsrc/include/vcpkg/base/util.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index c73345719..7266fbbc6 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,17 @@ namespace vcpkg::Util } } + namespace Maps + { + template + void transform_values(const std::unordered_map& container, std::unordered_map& output, Func func) + { + std::for_each(container.cbegin(), container.cend(), [&](const std::pair& p) { + output[p.first] = func(p.second); + }); + } + } + template using FmapOut = decltype(std::declval()(*begin(std::declval()))); -- cgit v1.2.3 From 3a91b0072d7500f2be84fe4d6520e8469ba5b5ad Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 24 Mar 2018 01:04:48 -0700 Subject: Fix name --- toolsrc/include/vcpkg/dependencies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 33af6c4f5..fea0d88a9 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -175,7 +175,7 @@ namespace vcpkg::Dependencies const std::vector& specs, const StatusParagraphs& status_db); - std::vector create_feature_install_plan(const PortFileProvider& port_file_provider, + std::vector create_feature_install_plan(const PortFileProvider& provider, const std::vector& specs, const StatusParagraphs& status_db); -- cgit v1.2.3