aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/vcpkg_Util.h
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-10-05 13:51:28 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-10-05 18:27:07 -0700
commit9a963f7eff1981d4e894ea8b297d092cda60b764 (patch)
treeab7da468d01a9e4e18dbbd84aa7f6597695700c1 /toolsrc/include/vcpkg_Util.h
parent7f68aa6630f96f474e85cd332dbbdc1ce6226d50 (diff)
downloadvcpkg-9a963f7eff1981d4e894ea8b297d092cda60b764.tar.gz
vcpkg-9a963f7eff1981d4e894ea8b297d092cda60b764.zip
Overhaul VS selection. Add triplet option to specify VS instance
Diffstat (limited to 'toolsrc/include/vcpkg_Util.h')
-rw-r--r--toolsrc/include/vcpkg_Util.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h
index e5ead6d3a..a87045d73 100644
--- a/toolsrc/include/vcpkg_Util.h
+++ b/toolsrc/include/vcpkg_Util.h
@@ -67,6 +67,21 @@ namespace vcpkg::Util
return std::find_if(cont.cbegin(), cont.cend(), pred);
}
+ template<class Container>
+ using ToVectorOfConstPointersT = std::decay_t<decltype(*std::begin(std::declval<Container>()))>;
+
+ template<class Container, class T = ToVectorOfConstPointersT<Container>>
+ std::vector<const T*> to_vector_of_const_pointers(const Container& cont)
+ {
+ std::vector<const T*> output;
+ for (auto i = cont.cbegin(), cend = cont.end(); i != cend; ++i)
+ {
+ output.push_back(&(*i));
+ }
+
+ return output;
+ }
+
template<class Container, class Pred>
auto find_if_not(const Container& cont, Pred pred)
{