This is the mail archive of the
mailing list for the libstdc++ project.
Re: Should basic_*stream::is_open() be const?
- From: Matt Austern <austern at apple dot com>
- To: Andreas Kohn <andreas at syndrom23 dot de>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 12 Aug 2004 19:02:36 -0700
- Subject: Re: Should basic_*stream::is_open() be const?
- References: <email@example.com>
On Aug 12, 2004, at 5:24 PM, Andreas Kohn wrote:
while porting some code written for Microsoft Visual C++, I found that
the is_open() method of the different streams in <fstream> is not
This required that I had to remove const from a lot of places in the
code in question.
The basic_filebuf::is_open() is marked as const, and all
*stream::is_open() methods only reference basic_filebuf::is_open() in
their is_open() implementation.
I do not see a particular reason why the is_open() methods couldn't be
const as well.
I do know that there is a C++ Standard, but I don't have it for
reference, so I am not perfectly sure if this is a "bug" in libstdc++,
the Microsoft STL implementation, or perhaps an omission from the