From f0c23aeb6b238ee0ba2dc272ee4c193f2f777460 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Oct 2017 18:25:34 -0700 Subject: Completely rework Visual Studio detection - Now using vswhere.exe to detect all VS instance (2015 + 2017) - Default version preference order is now: stable, prerelease, legacy - Within each preference weight, the latest one is chosen - findVisualStudioInstallationInstances.ps1 now has a parameter to choose VS instance --- toolsrc/include/vcpkg_Util.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index a87045d73..facb7dd26 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -68,18 +68,12 @@ namespace vcpkg::Util } template - using ToVectorOfConstPointersT = std::decay_t()))>; + using ElementT = std::remove_reference_t()))>; - template> - std::vector to_vector_of_const_pointers(const Container& cont) + template> + std::vector element_pointers(Container&& cont) { - std::vector output; - for (auto i = cont.cbegin(), cend = cont.end(); i != cend; ++i) - { - output.push_back(&(*i)); - } - - return output; + return fmap(cont, [](auto&& x) { return &x; }); } template -- cgit v1.2.3