I know how to do this in other languages, but not C++, which I am forced to use here.
I have a Set of Strings that I\'m printing to out in a list, and they need a co
Using boost:
std::string add_str("");
const std::string sep(",");
for_each(v.begin(), v.end(), add_str += boost::lambda::ret(boost::lambda::_1 + sep));
and you obtain a string containing the vector, comma delimited.
EDIT: to remove the last comma, just issue:
add_str = add_str.substr(0, add_str.size()-1);