From acba2f6b30d2a62c596e20c67eedd6cfd15d6327 Mon Sep 17 00:00:00 2001 From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 13 Aug 2004 16:47:43 +0000 Subject: [PATCH] 2004-08-13 Paolo Carlini <pcarlini@suse.de> * include/std/std_fstream.h (class basic_ifstream, class basic_ofstream, class basic_fstream): Add const overloads of is_open, as per DR 365 [WP]. * docs/html/ext/howto.html: Add an entry for DR 365. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85948 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 7 ++++++ libstdc++-v3/docs/html/ext/howto.html | 6 +++++ libstdc++-v3/include/std/std_fstream.h | 32 ++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 000a35f1d3e0..c6a1b1c0e962 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2004-08-13 Paolo Carlini <pcarlini@suse.de> + + * include/std/std_fstream.h (class basic_ifstream, + class basic_ofstream, class basic_fstream): Add const overloads + of is_open, as per DR 365 [WP]. + * docs/html/ext/howto.html: Add an entry for DR 365. + 2004-08-12 Paolo Carlini <pcarlini@suse.de> * configure.ac: Specify version 1.8.5 in AM_INIT_AUTOMAKE. diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html index c085800c6005..5670c4697684 100644 --- a/libstdc++-v3/docs/html/ext/howto.html +++ b/libstdc++-v3/docs/html/ext/howto.html @@ -479,6 +479,12 @@ <dd>Change the format string to "%.0Lf". </dd> + <dt><a href="lwg-defects.html#365">365</a>: + <em>Lack of const-qualification in clause 27</em> + </dt> + <dd>Add const overloads of <code>is_open</code>. + </dd> + <dt><a href="lwg-defects.html#389">389</a>: <em>Const overload of valarray::operator[] returns by value</em> </dt> diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h index 040f5798b11a..3bb26382cbe8 100644 --- a/libstdc++-v3/include/std/std_fstream.h +++ b/libstdc++-v3/include/std/std_fstream.h @@ -1,6 +1,6 @@ // File based streams -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -282,7 +282,8 @@ namespace std * @brief Returns true if the external file is open. */ bool - is_open() const throw() { return _M_file.is_open(); } + is_open() const throw() + { return _M_file.is_open(); } /** * @brief Opens an external file. @@ -569,7 +570,14 @@ namespace std * @return @c rdbuf()->is_open() */ bool - is_open() { return _M_filebuf.is_open(); } + is_open() + { return _M_filebuf.is_open(); } + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 365. Lack of const-qualification in clause 27 + bool + is_open() const + { return _M_filebuf.is_open(); } /** * @brief Opens an external file. @@ -693,7 +701,14 @@ namespace std * @return @c rdbuf()->is_open() */ bool - is_open() { return _M_filebuf.is_open(); } + is_open() + { return _M_filebuf.is_open(); } + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 365. Lack of const-qualification in clause 27 + bool + is_open() const + { return _M_filebuf.is_open(); } /** * @brief Opens an external file. @@ -817,7 +832,14 @@ namespace std * @return @c rdbuf()->is_open() */ bool - is_open() { return _M_filebuf.is_open(); } + is_open() + { return _M_filebuf.is_open(); } + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 365. Lack of const-qualification in clause 27 + bool + is_open() const + { return _M_filebuf.is_open(); } /** * @brief Opens an external file. -- GitLab