
"Edward Diener" <eddielee@tropicsoft.com> writes:
[snip]
This can probably even be:
std::string msg((std::ostringstream() << "There have been " << users << "users logged on so far").str());
Unfortunately this is not possible, because operator<< returns a basic_ostream reference, not a stringstream reference.
I have to admit that I don't understand any of the reasons for using printf... functions or boost::format instead of the C++ string streams. The latter seem much more natural and easier to me, and are further supported by boost::lexical_cast to make trivial conversions to and from strings even easier.
Refer to my other posting for information on why printf-like mechanisms significantly aid translation. Using the stringstream mechanism, translation requires modifying the source code, which is not at all practical. -- Jeremy Maitin-Shepard