c++/846: stream types non-const members

Benjamin Kosnik bkoz@redhat.com
Sun Nov 26 23:45:00 GMT 2000


Richard, thanks for your bug report. 

This is not a bug, but rather a strict interpretation of the
standard. It's been a source of some confusion, however, as others
have also reported it as a bug in the standard.

It's been assigned 'Not A Defect' status, for the following reason:



73.  is_open should be const

Section: 27.8.1 lib.file.streams Status: NAD Submitter: Matt Austern
Date: 27 Aug 98

Classes basic_ifstream, basic_ofstream, and basic_fstream all have a
member function is_open. It should be a const member function, since
it does nothing but call one of basic_filebuf's const member
functions.

Rationale:

Not a defect. This is a deliberate feature; const streams would be
meaningless.


More information about the Gcc-bugs mailing list