std::ostringstream ostr; //output string stream
ostr << 123;
string str = ostr.str();
I know the above will work.
But I would like to combine the above two operation into a single line operation like below
string str = (ostr<<123).ToStr(); // not sure if there is to string function;
Can I clear the ostr before <<123? (of course in single line too)?