mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-01 04:08:46 -06:00
cmAlgorithm: Extend cmAppend capabilities
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -144,6 +145,13 @@ void cmDeleteAll(Range const& r)
|
||||
ContainerAlgorithms::DefaultDeleter<Range>());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void cmAppend(std::vector<T*>& v, std::vector<std::unique_ptr<T>> const& r)
|
||||
{
|
||||
std::transform(r.begin(), r.end(), std::back_inserter(v),
|
||||
[](const std::unique_ptr<T>& item) { return item.get(); });
|
||||
}
|
||||
|
||||
template <typename T, typename Range>
|
||||
void cmAppend(std::vector<T>& v, Range const& r)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user