Title
Incorrect treatment of rdbuf()->close() return type
Status
nad editorial
Section
[ifstream.members]
Submitter
Christopher Kohlhoff

Created on 2006-08-17.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [ifstream.members], p5:

Effects: Calls rdbuf()->close() and, if that function fails (returns false a null pointer), calls setstate(failbit) (which may throw ios_base::failure (27.4.4.3)).

Change [fstream.members], p5:

Effects: Calls rdbuf()->close() and, if that function fails (returns false a null pointer), calls setstate(failbit) (which may throw ios_base::failure (27.4.4.3)).

Date: 2006-08-17.00:00:00

I just spotted a minor problem in 27.8.1.7 [lib.ifstream.members] para 4 and also 27.8.1.13 [lib.fstream.members] para 4. In both places it says:

void close();

Effects: Calls rdbuf()->close() and, if that function returns false, ...

However, basic_filebuf::close() (27.8.1.2) returns a pointer to the filebuf on success, null on failure, so I think it is meant to say "if that function returns a null pointer". Oddly, it is correct for basic_ofstream.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3161
2006-08-17 00:00:00admincreate