Boost logo

Boost :

From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2004-04-21 17:45:08


"Edward Diener" <eddielee_at_[hidden]> 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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk