From -7895281066863230966 X-Google-Language: ENGLISH,ASCII X-Google-Thread: f78e5,7243bb67dd016622 X-Google-Attributes: gidf78e5,public From: ncm@nospam.cantrip.org (Nathan Myers) Subject: Re: basic_streambuf<>::in_avail() Date: 1999/03/19 Message-ID: <7crtbm$k14$1@shell7.ba.best.com>#1/1 X-Deja-AN: 456403355 Content-Transfer-Encoding: quoted-printable Approved: Fergus Henderson References: <%PUH2.5770$_n2.114958@carnaval.risq.qc.ca> X-Original-Date: 18 Mar 1999 14:05:42 -0800 Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: news@news.unimelb.edu.au X-Trace: izvestia.its.unimelb.edu.au 921828844 19125 128.250.29.17 (19 Mar 1999 07:34:04 GMT) Organization: http://www.cantrip.org/ X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANvH90eEDnX0m9pzZAQEZ0gGAlS2QNHV+SSU9zX2fzqQa3zTbfrbTWCNq L+ZCx2BISu2TWZqDWTtzgWYReo5+BX7u =NvHf Mime-Version: 1.0 NNTP-Posting-Date: 19 Mar 1999 07:34:04 GMT Newsgroups: comp.std.c++ X-MIME-Autoconverted: from 8bit to quoted-printable by ncar.UCAR.EDU id PAA17193 Claude Qu=E9zel wrote: >Is it that I don't understand the behaviour of in_avail() (most >probably) or that both VC++ and CPP Builder libraries are broken? The latter. >in_avail() is documented as: If a read position is available, returns >egptr() - gptr() otherwise returns showmanyc(). I thought that size >should be non zero in the following example. Is this right or what am >I missing? > >#include > >int main() >{ > std::stringstream ss; > ss << 1; > int size =3D ss.rdbuf()->in_avail(); // returns 0 (is this OK ?) > int temp; > ss >> temp; // reads 1 >} in_avail() in this example should return 1. If it fails to do so, you have a library bug. --=20 Nathan Myers ncm@nospam.cantrip.org http://www.cantrip.org/ --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]