C
CBFalconer
Robert said:.... snip ...
Thanks very much for the input. I sense from you the same sentiment
that I have seen expressed from other implementors, that the one
character max pushback mandate isn't well-received. Although the
Rationale doesn't provide any insight as to why this decision was made
I would assume it would be to support implementations that only provide
a single character pushback while keeping results consistent among
implementations that could provide more. Do you feel that there is a
better way to handle this, has there been any discussion on changing
this behavior in the Standard, and is this a common sentiment in your
experience?
Consider handling pushing back two characters, the second of which
is a '\n'. The system buffer is holding the next line, so where do
you put the '\n'? Single char pushback can be handled simply by
diddling the internal pointer to the buffered line. Anything more
involves complications.
To misquote Dijkstra, "pity the poor implementor".