🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #4057

IOSTREAM question : should ends manipulator flush buffer?

#4057
From: Stuart Maclean
Date: Tue, 16 Apr 1996 12:27
31 lines
1666 bytes
Hi, I'm currently implementing a stream class where the external
representation is a socket.  Whilst playing with the following

TCPSocket tcp;
....
Sockstream  ss( tcp );

ss << "Hello World!" << endl;
ss << "Hello World!" << ends;

I noticed that manipulator "endl" synchronises with the external
representation, but "ends" does not.  Tracing our IOStream library,
libg++-2.7.1, it indeed does not do a flush when using "ends".  In C++PL2
by Stroustrup, page 348 has a comment implying that "ends" should do a
flush.

Does anyone know the correct behaviour for "ends" in the Standard C++
Library, whatever that is and whenever it may appear 8-)

Any help gratefully appreciated.

Stuart

-- 
Stuart
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
Technical Details
Message-ID: <sdm-1604961139410001@galois.ecs.soton.ac.uk>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back

Show Full Headers
Complete Article Headers
From: S.D.Maclean@ecs.soton.ac.uk (Stuart Maclean)
Message-ID: <sdm-1604961139410001@galois.ecs.soton.ac.uk>
X-Original-Date: Tue, 16 Apr 1996 11:39:41 +0000
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 16 Apr 96 12:27:03 GMT
Approved: fjh@cs.mu.oz.au
Newsgroups: comp.std.c++
Subject: IOSTREAM question : should ends manipulator flush buffer?
Organization: University of Southampton
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMXOSKeEDnX0m9pzZAQHUQwF+Piwoee2lCYjpl5F0BHol2Dtc+eX5yFsW
 +8nUsbKSPEjY6NFn11Eybxo2/YBnr7OQ
 =jBmk