c++使用用空格拼接字符串_accumulate用法

std::accumulate(std::begin(x), std::end(x), string(), [](string &ss, string &s){return ss.empty() ? s : ss + " " + s;})
  • ss是初始值 string(),相当于上一个值
  • s为当前遍历的元素

https://blog.csdn.net/qq_39686486/article/details/93978047

posted @ 2022-07-22 23:51  douzujun  阅读(208)  评论(0编辑  收藏  举报