How to construct a std::string from a std::vector?
C++03 std::string s; for (std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i) s += *i; return s; C++11 (the MSVC 2010 subset) std::string s; std::for_each(v.begin(), v.end(), [&](const std::string &piece){ s += piece; }); return s; C++11 std::string s; for (const auto &piece : v) s += piece; return s; Don’t use std::accumulate for string concatenation, … Read more