std::stringstream as parameter to a function
问题 I have a std::vector<std::string> temp_results and I wish to use std::for_each to go through this vector and concatenate a string, so I concocted the following construction: std::stringstream ss; std::string res = std::for_each(temp_results.begin(), temp_results.end(), boost::bind(addup, _1, ss)); std::string addup(std::string str, std::stringstream ss) { ss << str; ss << ";"; return ss.str; } I get the following error, which is beyond my understanding: error C2475: 'std::basic_stringstream<