mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-30 20:59:12 +08:00
Introduce Vectors::concatenate()
This commit is contained in:
parent
e46ec53693
commit
798f8a91e4
@ -7,6 +7,18 @@
|
|||||||
|
|
||||||
namespace vcpkg::Util
|
namespace vcpkg::Util
|
||||||
{
|
{
|
||||||
|
template<class Container>
|
||||||
|
using ElementT = std::remove_reference_t<decltype(*begin(std::declval<Container>()))>;
|
||||||
|
|
||||||
|
namespace Vectors
|
||||||
|
{
|
||||||
|
template<class Container, class T = ElementT<Container>>
|
||||||
|
void concatenate(std::vector<T>* augend, const Container& addend)
|
||||||
|
{
|
||||||
|
augend->insert(augend->end(), addend.begin(), addend.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<class Cont, class Func>
|
template<class Cont, class Func>
|
||||||
using FmapOut = decltype(std::declval<Func>()(*begin(std::declval<Cont>())));
|
using FmapOut = decltype(std::declval<Func>()(*begin(std::declval<Cont>())));
|
||||||
|
|
||||||
@ -71,9 +83,6 @@ namespace vcpkg::Util
|
|||||||
return std::find_if(begin(cont), end(cont), pred);
|
return std::find_if(begin(cont), end(cont), pred);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Container>
|
|
||||||
using ElementT = std::remove_reference_t<decltype(*begin(std::declval<Container>()))>;
|
|
||||||
|
|
||||||
template<class Container, class T = ElementT<Container>>
|
template<class Container, class T = ElementT<Container>>
|
||||||
std::vector<T*> element_pointers(Container&& cont)
|
std::vector<T*> element_pointers(Container&& cont)
|
||||||
{
|
{
|
||||||
|
@ -145,7 +145,7 @@ namespace vcpkg::Install
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
output.insert(output.end(), t.files.begin(), t.files.end());
|
Util::Vectors::concatenate(&output, t.files);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::sort(output.begin(), output.end());
|
std::sort(output.begin(), output.end());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user