This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
sungetc
- From: Jason Merrill <jason at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 16 Apr 2002 16:37:09 +0100
- Subject: sungetc
Working on the performance stuff, I noticed that sungetc may or may not
return the character ungotten. The standard says
If the input sequence putback position is not available, returns
pbackfail().
and then for pbackfail,
Returns some value other than traits::eof() to indicate success.
So if there's already a putback position, sungetc returns the character
ungotten. If there isn't one, but we can create one, sungetc returns some
random non-EOF value. So the only thing you can usefully do with the
return value of sungetc is compare it to EOF. This seems like a defect to
me. Thoughts?
Jason