Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-04-22 08:15:32


Edward Diener wrote:

>Jeremy Maitin-Shepard wrote:
>
>
>>"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.
>>
>>
>
>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


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