🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gnu.g++.lib.bug
2 messages
2 total messages Started by Peter R. Ham Fri, 15 Dec 1989 18:46
Does '\n' flush streams?
#539
Author: Peter R. Ham
Date: Fri, 15 Dec 1989 18:46
18 lines
963 bytes
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?

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?

--
Peter Ham			PO Box 3430	(h)(415) 322-4390
MS Computer Science Student	Stanford, CA	ham@cs.stanford.edu
Stanford University 		94309		(o)(415) 723-2067
Re: Does '\n' flush streams?
#540
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads