This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]