aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-10-05 18:25:34 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-10-05 18:29:34 -0700
commitf0c23aeb6b238ee0ba2dc272ee4c193f2f777460 (patch)
treef998f1e1adf60222613ad4ff7607866ada63d369 /toolsrc/include
parent86f3a9dbbdc360db3716b878dd37f2dbec8e983c (diff)
downloadvcpkg-f0c23aeb6b238ee0ba2dc272ee4c193f2f777460.tar.gz
vcpkg-f0c23aeb6b238ee0ba2dc272ee4c193f2f777460.zip
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
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg_Util.h14
1 files changed, 4 insertions, 10 deletions
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<class Container>
- using ToVectorOfConstPointersT = std::decay_t<decltype(*std::begin(std::declval<Container>()))>;
+ using ElementT = std::remove_reference_t<decltype(*begin(std::declval<Container>()))>;
- template<class Container, class T = ToVectorOfConstPointersT<Container>>
- std::vector<const T*> to_vector_of_const_pointers(const Container& cont)
+ template<class Container, class T = ElementT<Container>>
+ std::vector<T*> element_pointers(Container&& cont)
{
- std::vector<const T*> 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<class Container, class Pred>