Mail Archives: djgpp/1999/05/28/19:53:08
> On Thu, 27 May 1999 17:10:33 +0200, Peter Claessens
> <peter DOT claessens AT psy DOT kuleuven DOT ac DOT be> wrote:
>
> ><strstream> is non-ANSI, correct? Is there somewhere an <sstream> file
> >available for djgpp? Or should I move to egcs?
> >
> as far as i know (read) strstream IS a ANSI/ISO standard c++ lib
>
> mimo
I'm not sure about that. In the online working copy of Bruce Eckel's
"Thinking in C++" I read "Before there were stringstreams, there were the
more primitive strstreams. ***Although these are not an official part of
Standard C++ ***, they have been around a long time so compilers will no
doubt leave in the strstream support in perpetuity, to compile legacy code.
You should always use stringstreams, but it’s certainly likely that you’ll
come across code that uses strstreams".
Let's summarize:
Bruce Eckel claims that strstream is not part of ANSI; The draft of the
proposed international standard mentions strstream as deprecated. I don't
know what the eventual specification states; I don't have it. The paper
book I'm using only mentions sstream.
I want to write standard C++ to make sure that my application is compilable
on PC, Mac, SGI platforms, and remains compilable for the next years (I
suspect that "in perpetuity" in the quote is an overstatement). The sprintf
function (which I didn't know - that's what happens if, as Stroustup and
many others advise, one learns C++ without learning C first) is probably
the best replacement at this moment. I don't know how long it will take for
djgpp and egcs to support real stringstreams; I don't find it in any 'to
do' list, or mentioned as 'missing'. In fact, I don't find any reference to
<sstream> at all. Sure, if I had the programming skills, I would help
implementing the standard. But I'm an autodidact and for now I have to
manage with what I find.
I realize that I can't expect as much from a non-commercial compiler as
from f.e. Visual C++, but I think that this represents too big a flaw. This
is not just a minor incompatibility - it's a whole header missing.
Regards,
Peter.
- Raw text -