summaryrefslogtreecommitdiffstats
path: root/Source/cmAlgorithms.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-12-05 15:09:27 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-12-05 16:20:56 (GMT)
commitd74416a9cde9876eff7148161cfdc3500125bb49 (patch)
tree06f0e215b6bde70f6fd31cdeba7860bba8e6938d /Source/cmAlgorithms.h
parent8ee4f372aad33eba556c2ec116498ea949dcf03c (diff)
downloadCMake-d74416a9cde9876eff7148161cfdc3500125bb49.zip
CMake-d74416a9cde9876eff7148161cfdc3500125bb49.tar.gz
CMake-d74416a9cde9876eff7148161cfdc3500125bb49.tar.bz2
cmGeneratorExpressionEvaluator: Modernize memory management
Diffstat (limited to 'Source/cmAlgorithms.h')
-rw-r--r--Source/cmAlgorithms.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index e83f160..def3ac7 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -146,6 +146,14 @@ void cmDeleteAll(Range const& r)
}
template <typename T>
+void cmAppend(std::vector<std::unique_ptr<T>>& v,
+ std::vector<std::unique_ptr<T>>&& r)
+{
+ std::transform(r.begin(), r.end(), std::back_inserter(v),
+ [](std::unique_ptr<T>& item) { return std::move(item); });
+}
+
+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),