This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC/Patch] What about using seekoff(-1, ...) for unbuffered underflow?
On Fri, Jun 06, 2003 at 11:23:36PM +0200, Paolo Carlini wrote:
> What to do?
>
> 1- Adding another hidden "pback" area only for unbuffered sgetc()-type
> situations: this answers my last concern but definitely not yours
> involving locales.
This strikes me as the best approach. Essentially, with streambufs
there's no such thing, really, as unbuffered, because sgetc implies
a one-character buffer. So, when it's supposed to be unbuffered,
instead use a one-character buffer. (This relates to users calling
setbuf with a one-character buffer being, properly, equivalent to
running unbuffered; the only difference is in who owns the buffer.)
You shouldn't let locales confuse matters. The right approach to
buffering isn't affected by locale concerns.
Nathan Myers
ncm-nospam@cantrip.org