I\'d like to build a std::string from a std::vector.
I could use std::stringsteam, but imagine there is a s
Why not just use operator + to add them together?
std::string string_from_vector(const std::vector &pieces) {
return std::accumulate(pieces.begin(), pieces.end(), std::string(""));
}
std::accumulate uses std::plus under the hood by default, and adding two strings is concatenation in C++, as the operator + is overloaded for std::string.