🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.lib.bug
Article #540

Re: Does '\n' flush streams?

#540
From: Ron Guilmette
Date: Sat, 16 Dec 1989 02:42
29 lines
1498 bytes
In article <HAM.89Dec15104637@Neon.Stanford.EDU> ham@Neon.Stanford.EDU (Peter R. Ham) writes:
>I've asked this question before, but here goes again.
>Should
>
>cout << "\n" 
>
>flush cout?
>
>The libg++ test suite seems to imply that it should.  I'm not getting
>that behavior on the pmax.  Maybe I should go debug the thing?

Peter,

It doesn't.  The problem is that streams have not been `line buffered'
in the releases up to and including 1.36.1.

Doug Lea assures me however that libg++ 1.36.2 (when available) will do
line buffering (rather than block buffering) on streams.

>In Stroustrup's book, it says that and ostream should be flushed
>in its destructor. The libg++ ~ostream doesn't seem to to this.
>What am I missing?

Perhaps nothing.  I also noticed that stdout was not getting flushed
on program exit in libg++ 1.36.1 (and I reported it to Doug L.).
Sounds like your's could be a (very) related problem, so perhaps Doug
will have these both fixed in 1.36.2.

// rfg
Technical Details
Message-ID: <2589AB90.19694@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg
References: <HAM.89Dec15104637@Neon.Stanford.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg
From: rfg@ics.uci.edu (Ron Guilmette)
Newsgroups: gnu.g++.lib.bug
Subject: Re: Does '\n' flush streams?
Message-ID: <2589AB90.19694@paris.ics.uci.edu>
Date: 16 Dec 89 02:42:23 GMT
References: <HAM.89Dec15104637@Neon.Stanford.EDU>
Reply-To: Ron Guilmette <rfg@ics.uci.edu>
Distribution: gnu
Organization: University of California, Irvine - Dept of ICS
Lines: 29