Boost logo

Boost Users :

Subject: [Boost-users] Reply: Possible bug: ostringstream
From: Jammy Cheng Chen (Jammy.Chen_at_[hidden])
Date: 2010-12-09 21:50:05


It didn't related Boost in following piece of code, but I know some guys was discussed the similar issue in this mail list before, so I want get help from there.

Thanks
Jammy

-----Original Mail-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] Steven Watanabe
Send Date 2010Äê12ÔÂ9ÈÕ 18:22
Sent: boost-users_at_[hidden]
Subject: Re: [Boost-users] Possible bug: ostringstream

AMDG

On 12/8/2010 10:32 PM, Jammy Cheng Chen wrote:
> I have come across a bug associated the following code, it work fine in
> VS2008 release mode and crash in debug mode, I did some research found
> it should be a bug in the microsoft implementation of ostringstream, Is
> anybody know how to fix this or alternative way? Any ideas would be
> appreciated.
>
> BTW: I must use std::ostringstream because actually lot of dependencies
> dll was developed with std::ostringstream.str() return. I don't want
> change the dependencies project it wastes too much.
>
> std::string result( "" );
> size_t length = source.size();
> std::ostringstream offset;
> long offsetsToSource = 12135L;
> offset<< offsetsToSource;
>
> std::string nsource = offset.str();
> result.reserve( nsource.length() * 1.6 );
> std::for_each( nsource.begin(), nsource.end(),ToXML( result, "\"&<>" ));
>

Um. What exactly does this have to do with Boost?

In Christ,
Steven Watanabe

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net