This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH : basic_fstream::is_open()
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: PATCH : basic_fstream::is_open()
- From: Richard Andrews <richarda at ixla dot com dot au>
- Date: Tue, 16 Jan 2001 14:35:17 +1100
Hi all,
inheriting from fstream I've noticed that is_open() is not const for basic_ofstream, basic_ifstream and basic_fstream. I think these members should be const.
The following is a patch to bits/std_fstream.h taken from the 20010115 codesourcery build
Can someone please verify this and check it in?
Rich
diff -u orig.std_fstream.h std_fstream.h
--- orig.std_fstream.h Tue Jan 16 14:17:19 2001
+++ std_fstream.h Tue Jan 16 14:18:16 2001
@@ -267,7 +267,7 @@
{ return static_cast<__filebuf_type*>(_M_streambuf); }
bool
- is_open(void) { return rdbuf()->is_open(); }
+ is_open(void) const { return rdbuf()->is_open(); }
void
open(const char* __s, ios_base::openmode __mode = ios_base::in)
@@ -324,7 +324,7 @@
{ return static_cast<__filebuf_type*>(_M_streambuf); }
bool
- is_open(void) { return rdbuf()->is_open(); }
+ is_open(void) const { return rdbuf()->is_open(); }
void
open(const char* __s,
@@ -383,7 +383,7 @@
{ return static_cast<__filebuf_type*>(_M_streambuf); }
bool
- is_open(void) { return rdbuf()->is_open(); }
+ is_open(void) const { return rdbuf()->is_open(); }
void
open(const char* __s,