[RFC] Another look at LFS vs filebuf::showmanyc
Nathan Myers
ncm-nospam@cantrip.org
Mon Sep 20 18:52:00 GMT 2004
On Mon, Sep 20, 2004 at 07:55:56PM +0200, Dirk Jagdmann wrote:
> > What about returning numeric_limits<streamsize>::max() in such cases?
>
> sounds reasonable, because that way you have usable code. And I don't
> think someone really wants to do something like
> std::vector<int> (stream.rdbuf().showmanyc());
> with possible >2G of characters on a 32bit platform.
>
> And further showmanyc() is required to return *a* number of characters
> that can be read with blocking, but not necessarily the maximum
> number.
I agree. I see little benefit to ever returning a value bigger
than (say) 1M. Is this the only place where the streamsize proves
too small to yield the (strictly) correct answer? That would be
uncommonly good luck.
Nathan Myers
ncm-nospam@cantrip.org
More information about the Libstdc++
mailing list