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]

Re: sungetc



> >> 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. ...

I wrote:
> > You can usefully use sungetc if you know that there is never more than
> > one pushback character...

Jason wrote:
> I think you misunderstood my point.  I was complaining about the
> specification of the return value, not the size of the putback buffer.
> IMO, if we can put back a character, we should return that character.

Yes, you're right, I was confused by the language about putback positions,
I thought it meant that the putback buffer was already full.

> Currently, if we do a putback when we are at the beginning of the read
> buffer, we return 0, whereas if we are in the middle of the read buffer we
> return the character.

I agree that this seems odd and useless.



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