Article View: comp.std.c++
Article #2799streambuf derivation error or bug in istream::getline?
From: Christopher Barber
Date: Fri, 01 Dec 1995 16:05
Date: Fri, 01 Dec 1995 16:05
23 lines
1661 bytes
1661 bytes
I have derived a new class from streambuf and overloaded most of the virtual protected members (overflow, underflow, xsgetn, xsputn, etc) but do not touch the stream pointer methods (setg, gbump, setp, etc) and as far as I understand the standard I don't need to. The problem is that the implementation of istream::getline which I am using (in gnu libio - I don't know the version offhand) accesses the gbeg, gnext, gend pointers directly and ends up in an infinite loop when these pointers are null (which is their default value). I think this is a bug in the istream::getline implementation, but given the complexity of the iostream classes am willing to consider the possiblity that I have just misunderstood the spec. Anyone, care to comment? - Chris -- Christopher Barber Software Engineer BBN, Systems and Technologies mailto:cbarber@bbn.com http://malachite.bbn.com/~cbarber (within bbn) [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<CBARBER.95Dec1093812@figaro.bbn.com>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: cbarber@bbn.com (Christopher Barber) Newsgroups: comp.std.c++ Subject: streambuf derivation error or bug in istream::getline? Date: 1 Dec 1995 16:05:02 GMT Organization: BBN Approved: clamage@eng.sun.com (comp.std.c++) Distribution: world Message-ID: <CBARBER.95Dec1093812@figaro.bbn.com> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: figaro.bbn.com Content-Length: 914 X-Lines: 19 Originator: clamage@taumet