delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/28/19:53:08

From: Peter Claessens <peter DOT claessens AT student DOT kuleuven DOT ac DOT be>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: s((tr(ing))stream)
Date: Sat, 29 May 1999 01:17:50 +0200
Organization: KULeuvenNet
Lines: 44
Message-ID: <374F241E.14FA6D05@student.kuleuven.ac.be>
References: <374D6068 DOT ADC07F3C AT psy DOT kuleuven DOT ac DOT be> <374dd797 DOT 3344247 AT news DOT wanadoo DOT fr>
NNTP-Posting-Host: marvin.kulnet.kuleuven.ac.be
Mime-Version: 1.0
X-Trace: naxos.belnet.be 927933510 1842 134.58.127.3 (28 May 1999 23:18:30 GMT)
X-Complaints-To: abuse AT belnet DOT be
NNTP-Posting-Date: 28 May 1999 23:18:30 GMT
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
Cache-Post-Path: marvin!unknown AT kn-10-0-46-002 DOT kotnet DOT kuleuven DOT ac DOT be
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019