summaryrefslogtreecommitdiffstats
path: root/Source/cmList.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmList.cxx')
-rw-r--r--Source/cmList.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmList.cxx b/Source/cmList.cxx
index 3835e59..939fbb5 100644
--- a/Source/cmList.cxx
+++ b/Source/cmList.cxx
@@ -803,27 +803,35 @@ cmList& cmList::transform(TransformAction action,
return *this;
}
-std::string& cmList::append(std::string& list, cm::string_view value)
+std::string& cmList::append(std::string& list, std::string&& value)
{
if (list.empty()) {
- list = std::string(value);
+ list = std::move(value);
} else {
list += cmStrCat(cmList::element_separator, value);
}
return list;
}
+std::string& cmList::append(std::string& list, cm::string_view value)
+{
+ return cmList::append(list, std::string{ value });
+}
-std::string& cmList::prepend(std::string& list, cm::string_view value)
+std::string& cmList::prepend(std::string& list, std::string&& value)
{
if (list.empty()) {
- list = std::string(value);
+ list = std::move(value);
} else {
list.insert(0, cmStrCat(value, cmList::element_separator));
}
return list;
}
+std::string& cmList::prepend(std::string& list, cm::string_view value)
+{
+ return cmList::prepend(list, std::string{ value });
+}
cmList::size_type cmList::ComputeIndex(index_type pos, bool boundCheck) const
{