In what ways can you use the return values from things like boost::algorithm::join?
std::stringstream ss;
ss<<"quack";
std::cout << ss.str().c_str() << std::endl; // bad idea
This is a bad idea, explained in sbi's comment in https://stackoverflow.com/a/1430774/
std::vector<std::string> v;
v.push_back("foo");
v.push_back("bar");
std::cout << boost::algorithm::join(v,"-").c_str() << std::endl; // what about this?
That made me wonder if this has the same problem?
Could someone give an explanation of the scope of such return values?