basic_ios::fail() question

Ryszard Kabatek rysio@rumcajs.chemie.uni-halle.de
Thu Dec 30 07:30:00 GMT 1999


The basic_ios::fail() member function returns true if the eofbit
or the failbit is set.                                    ------

 bool fail () const { return (rdstate () & (eofbit | failbit)) != 0; }

Why the eofbit? I would expect the badbit instead.
                                   ------
 bool fail () const { return (rdstate () & (badbit | failbit)) != 0; }


Ryszard Kabatek
Martin-Luther University Halle-Wittenberg, Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129




More information about the Libstdc++ mailing list