[lug] OT: C++ strstreams?

D. Stimits stimits at idcomm.com
Thu Apr 11 16:49:14 MDT 2002


"Scott A. Herod" wrote:
> 
> Hello,
> 
>   Quick question: my reference book says that strstreams
> are deprecated.  True?  Then what is the replacement?

I believe that is correct, and <sstream> is it. However, don't believe
it for a while, there are a lot of RH 6.x and other distros out there
that do not yet have sstream, but there is some apples-and-oranges
comparison there. <strstream> is more about string-like character
sequence buffering, while <sstream> is about string enhanced
manipulations based on that underlying buffer. I keep seeing conflicting
comments on it, and have avoided using either of them because either one
is not present on a system, or the other is not present. Unfortunately,
I've found std::string to be more useful if it has to run on both older
and newer systems (which isn't as efficient). On the other hand, some of
the reasons for using streams are rather compelling, I'm probably going
to start using streams in place of strings and tell people to upgrade,
once there are fewer RH 6.x distros out there (yeah, right, cry foul!).

Now if you want to do a little of your own comparisons, and the system
has g++, try comparing /usr/include/g++-2/ (older) with
/usr/include/g++-3/ (newer) directories (RH directory structure,
probably others too). Look for "*stream".

D. Stimits, stimits at idcomm.com

> 
> Thanks,
> 
> Scott
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list