| 67 | /** Joins elements of a range with separator into a single string. */ |
| 68 | template <typename Range> |
| 69 | std::string cmJoin(Range const& rng, cm::string_view separator) |
| 70 | { |
| 71 | if (rng.empty()) { |
| 72 | return std::string(); |
| 73 | } |
| 74 | |
| 75 | std::ostringstream os; |
| 76 | auto it = rng.begin(); |
| 77 | auto const end = rng.end(); |
| 78 | os << *it; |
| 79 | while (++it != end) { |
| 80 | os << separator << *it; |
| 81 | } |
| 82 | return os.str(); |
| 83 | } |
| 84 | |
| 85 | /** Generic function to join strings range with separator |
| 86 | * and initial leading string into a single string. |
searching dependent graphs…