From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-03-19 13:42:50
On Wed, 19 Mar 2003 11:12:28 -0600, "Ed Brey" <brey_at_[hidden]>
>It's interesting that the people you read about don't think of '\n' conceptually as an object.
It's interesting that some people think they should :-)
>Mis-use of endl doesn't seem to be adequet justification for a new
>end-of-line specifier. However, a difference in behavior between '\n'
>and endl does.
Indeed. And there are obvious differences:
>>> - Why not other control functions, e.g. tab?
>> Never thought of it. Anyway, the C and C++ standard libraries already
>> have accommodations for line-based text processing, but not for other
>> control characters.
>True. Presumably, then, the same subtle effects that would compel an
>alternative to '\n' wouldn't do likewise for '\t'. Is that correct?
The effect is exactly the same and there's nothing subtle about it.
BTW, a non-flushing endl, as well as almost everything has been
proposed here, are plain classics. Apart from the hundreds of
newsgroup questions about '\n' vs. endl, I remember dozens of articles
about array based stream buffers for instance. I don't have time to
search for pointers right now (some of them were in CUJ) and,
unfortunately, I don't think I would search them even if I could.
Judging from the replies I got, seems like I've already wasted enough
time with the review:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk