| 91 | |
| 92 | template <typename T> |
| 93 | std::string VectorToCSV(const std::vector<T>& values) { |
| 94 | if (values.empty()) { |
| 95 | return ""; |
| 96 | } |
| 97 | |
| 98 | std::ostringstream stream; |
| 99 | stream.imbue(std::locale::classic()); |
| 100 | for (const T& value : values) { |
| 101 | stream << value << ", "; |
| 102 | } |
| 103 | std::string buf = stream.str(); |
| 104 | buf.resize(buf.size() - 2); |
| 105 | return buf; |
| 106 | } |
| 107 | |
| 108 | template <typename T> |
| 109 | std::vector<T> CSVToVector(const std::string& csv) { |
no test coverage detected