![]() |
От: |
Кодт
|
|
Дата: | 19.06.23 09:51 | ||
Оценка: | +1 |
SP>auto join(std::string separator) {
SP> return [sep = std::move(separator)](std::string res, const std::string& to_add) {
SP> return res.empty() ? to_add : std::move(res) + sep + to_add; };
SP>}
SP>
auto j = join(",");
string acc = "";
acc = j(acc, "");
acc = j(acc, "");
acc = j(acc, "3");
acc = j(acc, "4");