If, after writing return ss.str;, you intend to call a member function strfrom std::stringstream, then you are missing a pair of brackets:
return ss.str();
, , , , . , addup std::stringstream, : addup boost::ref() ss boost::bind.
, , , :
void addup(std::string str, std::stringstream &ss)
{
ss << str;
ss << ";";
}
int main()
{
std::vector<std::string> temp_results;
std::stringstream ss;
std::for_each(temp_results.begin(), temp_results.end(), boost::bind(addup, _1, boost::ref(ss)));
std::cout << ss.str() << std::endl;
}
boost::lambda:
std::for_each(temp_results.begin(), temp_results.end(), ss << boost::lambda::_1 << ';');