| 16 | */ |
| 17 | template <class TIterator> |
| 18 | std::string |
| 19 | joinToString(TIterator begin, TIterator end, const std::string& separator) { |
| 20 | if (begin == end) |
| 21 | return std::string(); |
| 22 | |
| 23 | std::string first = *begin; |
| 24 | |
| 25 | return std::accumulate( |
| 26 | ++begin, |
| 27 | end, |
| 28 | std::move(first), |
| 29 | [&separator](const std::string& acc, const std::string& element) { |
| 30 | return acc + separator + element; |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @brief Joins multiple elements together into a string, separated by a given |
no outgoing calls
no test coverage detected