
22 Apr
2004
22 Apr
'04
1:15 p.m.
Edward Diener wrote:
Jeremy Maitin-Shepard wrote:
"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.
OK, I see, Doing an .str() on a basic_ostream reference won't work. Maybe:
std::string msg((dynamic_cast<const std::ostringstream &>(std::ostringstream() << "There have been " << users << "users logged on so far")).str());
but it begins to look a but ugly.
my point exactly :D Best, John