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: [RFC] A stream buffer for wcin


Nathan Myers wrote:
> My impression of the suggested patch is that it involves calling
> underflow on every character, rather than buffering.

Yes, unless wcin somehow has access to stdin's internal buffer,
I don't see how this can be avoided for the case when
ios_base::sync_with_stdio(false) hasn't been called.

> If it is necessary for good performance to make wcin and wstdin 
> each do a sync operation between switching between them, that seems 
> a small price to pay.

I don't see how such a sync operation could be implemented, there
is no portable way to put back more than one character to stdin,
and I'm not aware of any way to get access to the conversion state.

However, if ios_base::sync_with_stdio(false) has been called,
there is no need to sync wcin with stdin. In that case a buffered
wfilebuf can be used for wcin.

Petur


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