| 216 | //! A helper function similar to sep.join(list) in Python. |
| 217 | template <typename T> |
| 218 | std::string joinValuesToString(std::vector<T> const& list, std::string const& sep) |
| 219 | { |
| 220 | std::ostringstream os; |
| 221 | for (int32_t i = 0, n = list.size(); i < n; ++i) |
| 222 | { |
| 223 | os << list[i]; |
| 224 | if (i != n - 1) |
| 225 | { |
| 226 | os << sep; |
| 227 | } |
| 228 | } |
| 229 | return os.str(); |
| 230 | } |
| 231 | |
| 232 | template <typename T, size_t N> |
| 233 | std::string joinValuesToString(std::array<T, N> const& list, std::string const& sep) |
no test coverage detected