C++ Using stringstream after << as parameter
问题 Is it possible to write a method that takes a stringstream and have it look something like this, void method(string str) void printStringStream( StringStream& ss) { method(ss.str()); } And can be called like this stringstream var; printStringStream( var << "Text" << intVar << "More text"<<floatvar); I looked up the << operator and it looks like it returns a ostream& object but I'm probably reading this wrong or just not implementing it right. Really all I want is a clean way to concatenate