------- Comment #2 from qwak82 at gmail dot com 2010-06-07 11:36 ------- But also fail bit, this program prints: line: a //this is OK, first line line: //this is also OK, second (empty) line fail bit //eof is set - OK; but fail bit should be set here?
#include <iostream> #include <sstream> int main() { std::istringstream s("a\n"); while (s.good()) { std::string line; std::getline(s, line); std::cout << "line: " << line << std::endl; } if (s.fail()) std::cout << "fail bit"; return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44441