[v3] more istream::ignore cleanups

Paolo Carlini pcarlini@suse.de
Tue Jan 4 19:30:00 GMT 2005


Benjamin Kosnik wrote:|

>Ah ha. Thanks Gaby for the key bit. Serves me right for thinking it was
>simple and not looking though the archives... I can see why Paolo was so
>exclamatory now!
>
Sorry about that Benjamin, but I have been refininf and tweaking those 
function
both from the conformance and the performance point of views for months, you
know! I'm going in vacations for just a few days and was *really* afraid of
possible regressions.

>It looks like, in these situations, _M_gcount should be set to
>numeric_limits::max() here. Ie, in the LFS case, say delim is at max +
>5, _M_gcount will not be set correctly (ie, not max().)
>  
>
Indeed, we can have that, if we want: whatever we do is not strictly 
speaking
conforming since the number of extracted chars in principle should always
match gcount and with LFS can be much bigger. The current (and recent)
situation) gives the user more information (i.e. at least the "modulo" 
of the
total number of extracted chars) whereas returning max() is more clean. Let
me think a little more about it: we can always set _M_gcount = max at the
end if we eventually decide to do that, without changing the main loop.

>...yes, please do. I see a couple previous requests for this as well as
>something that fails, test-wise, in the archives. Hopefully something
>along these lines will prevent others from going at this half-baked as
>well... 
>  
>
Agreed!

Paolo.



More information about the Libstdc++ mailing list