From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-06-04 04:13:30
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Ed Brey
| Sent: Tuesday, June 03, 2003 2:49 PM
| To: boost_at_[hidden]
| Subject: [boost] Re: Re: I/O library status
| Beyond these are the performance concerns of course;
| rather than the more efficient and arguably more readable:
| cout <<
| "My first line" "\n"
| "My second line";
Are you sure that this is more efficient?
"My first line" << endl <<
"My second line";
has proven LESS efficient and I suspect the flush caused by encountering \n will
have the same effect. Of course, the differences are tiny in practice.
I view the newl as much clearer. And the concept that endl actually writes the
buffered output doesn't seem too complicated.
As a non-C programmer, "\n" looks plain nasty to me :-(
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk