This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TC1 status.
Section: 188.8.131.52 [istream.unformatted], 184.108.40.206.5 [ostream.seeks] Status: TC1 Submitter: Angelika Langer Opened: 1999-02-22 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [istream.unformatted].
View all issues with TC1 status.
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.
Add to the Effects: clause of seekg() in 220.127.116.11 [istream.unformatted] and to the Effects: clause of seekp() in 18.104.22.168.5 [ostream.seeks]:
In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).
Setting failbit is the usual error reporting mechanism for streams