| 66 | |
| 67 | template <typename T, typename F, std::enable_if_t<std::is_invocable_v<F, typename T::value_type>, int> = 0> |
| 68 | std::string StringJoin(const T &con, F &&f, std::string_view sep = ", ") { |
| 69 | std::string res; |
| 70 | bool is_first = true; |
| 71 | for (const auto &v : con) { |
| 72 | if (is_first) { |
| 73 | is_first = false; |
| 74 | } else { |
| 75 | res += sep; |
| 76 | } |
| 77 | res += std::forward<F>(f)(v); |
| 78 | } |
| 79 | return res; |
| 80 | } |
| 81 | |
| 82 | template <typename T> |
| 83 | std::string StringJoin(const T &con, std::string_view sep = ", ") { |