Commit 101b5288 authored by Marc Chevrier's avatar Marc Chevrier

cmAlgorithm: Extend cmAppend capabilities

parent eb306700
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment