Hello,
I was thinking about one solution, but no luck.
suppose I have an std::string object.
I want to be able to use this string like std::ostringstr eam.
something like:
string str;
ostringstream out(str);
out << "Hello world." << 123;
and then str should contain "Hello world.123". Basicly, I heed a
specified string object be a underlying buffer for a ostringstream
object. How can I do that?
Should I write another class derived from streambuf or something???
Thanks for any ideas.
I was thinking about one solution, but no luck.
suppose I have an std::string object.
I want to be able to use this string like std::ostringstr eam.
something like:
string str;
ostringstream out(str);
out << "Hello world." << 123;
and then str should contain "Hello world.123". Basicly, I heed a
specified string object be a underlying buffer for a ostringstream
object. How can I do that?
Should I write another class derived from streambuf or something???
Thanks for any ideas.
Comment