M
Michael Mellor
I see so many posts on this newsgroup where people use std::endl but I
can't see why or where they are getting it from. std::endl outputs a new
line and flushes the stream's buffer. It is even 15.7 in the C++ FAQ. In
my quick benchmarking* '\n' outperformed std::endl by over 4 times when
writing to the hard drive and is 5 less characters to type** .
Are there books out there which tell people to use std::endl? Did
pre-standard C++ not require std::endl to flush the stream?
I hope this rant may stop a couple of people using std::endl except
where it is actually needed because it really annoys me.
Michael Mellor
*g++ 3.3.1 under Cygwin on Windows XP
**Obviously an appropriate using will remove that advantage.
can't see why or where they are getting it from. std::endl outputs a new
line and flushes the stream's buffer. It is even 15.7 in the C++ FAQ. In
my quick benchmarking* '\n' outperformed std::endl by over 4 times when
writing to the hard drive and is 5 less characters to type** .
Are there books out there which tell people to use std::endl? Did
pre-standard C++ not require std::endl to flush the stream?
I hope this rant may stop a couple of people using std::endl except
where it is actually needed because it really annoys me.
Michael Mellor
*g++ 3.3.1 under Cygwin on Windows XP
**Obviously an appropriate using will remove that advantage.