Introduce Util::Sets::contains()

This commit is contained in:
Alexander Karatarakis 2017-10-26 18:59:11 -07:00
parent 286625e09e
commit 8a952743a3

View File

@ -20,6 +20,15 @@ namespace vcpkg::Util
}
}
namespace Sets
{
template<class Container, class T = ElementT<Container>>
bool contains(const Container& container, const T& item)
{
return container.find(item) != container.cend();
}
}
template<class Cont, class Func>
using FmapOut = decltype(std::declval<Func>()(*begin(std::declval<Cont>())));