New issue 110 by Van...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110
With regard to deprecation, support of strstream could be removed from
future versions of compilers. Actually in my environment there isn't one.
Can we replace strstream with stringstream or make it an option? Maybe
through some HAVE_STRSTREAM flag? Is there any performance advantage of
using strstream?
This makes linking fail on OSX using clang++ (3.0) with -std=c++0x and
-stdlib=libc++. The attached patch fixes the problem, which is that
strstream doesn't exist with these options.
Attachments:
glog-stringstream.patch 1.9 KB
Can we also replace ostrstream with ostringstream ?
Here is a patch that replaces strstream with stringstream and removes
inclusion of deprecated header.
Signed the "Individual Contributor License Agreement" form, so you can use
the code.
Attachments:
strstream_deprecated.patch 5.8 KB
Oops, seems like ostringstream doesn't support specifying char buffer as a
backend. Sad :(
I think I can implement a custom std::stringbuf as suggested here:
http://stackoverflow.com/questions/1494182/setting-the-internal-buffer-used-by-a-standard-stream-pubsetbuf
Or just copy output string using stringstream::str() function