Section: 188.8.131.52 [lib.string.io] paragraphs 1-3
Date: Feb 4, 2000
The description of the stream extraction operator for std::string
(section 184.108.40.206 [lib.string.io]) does not contain a requirement
that failbit be set in the case that the operator fails to extract
any characters from the input stream.
This implies that the typical construction
while (is >> str) ... ;
(which tests failbit) is not required to terminate at EOF.
Furthermore, this is inconsistent with other extraction operators,
which do include this requirement. (See sections
220.127.116.11 [lib.stream.formatted] and 18.104.22.168 [lib.stream.unformatted],
where this requirement is present, either explictly or implicitly,
for the extraction operators. It is also present explicitly in the
description of getline (istream&, string&, charT) in
section 22.214.171.124 paragraph 8.)
Insert new paragraph after paragraph 2 in section 126.96.36.199:
If the function extracts no characters, it calls is.setstate(ios::failbit)
which may throw ios_base::failure (188.8.131.52).
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]