This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]