Created on 1999-02-22.00:00:00 last changed 172 months ago
Rationale:
Setting failbit is the usual error reporting mechanism for streams
Proposed resolution:
Add to the Effects: clause of seekg() in [istream.unformatted] and to the Effects: clause of seekp() in [ostream.seeks]:
In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).
Currently, the standard does not specify how seekg() and seekp() indicate failure. They are not required to set failbit, and they can't return an error indication because they must return *this, i.e. the stream. Hence, it is undefined what happens if they fail. And they can fail, for instance, when a file stream is disconnected from the underlying file (is_open()==false) or when a wide character file stream must perform a state-dependent code conversion, etc.
The stream functions seekg() and seekp() should set failbit in the stream state in case of failure.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg1468 |
2010-10-21 18:28:33 | admin | set | messages: + msg1467 |
1999-02-22 00:00:00 | admin | create |