Rewrite svg array_to_string()

This commit is contained in:
Thomas Krijnen
2021-01-02 13:08:01 +01:00
parent 979f37d7c6
commit b91dfb401d
+2 -2
View File
@@ -1336,9 +1336,9 @@ namespace {
template <typename T>
std::string array_to_string(const T& v) {
return "[" + std::accumulate(
++v.begin(), v.end(),
v.begin() + 1, v.end(),
array_to_string(v.front()),
[](const std::string& accum, auto const & item) {
[](const std::string& accum, decltype(*v.cbegin())& item) {
return accum + "," + array_to_string(item);
}) + "]";
}