N
Nick Hounsome
Hendrik Schober said:FTR, I just found another one:
Sorry - this is wrong.
std::istream::traits_type::eof();const std::istream::char_type chEof =
Hopefully your compiler will warn you that this is a narrowing assignment.
eof() returns int_type where int_type is required to hold
"all of the valid characters of char_type plus the end-of-file value eof()"
std::string f( std::istream& is )
{
std::string tmp;
std::getline( is, tmp, chEof );
probably gets up to a character that has the same low order bits as EOF.
If EOF is -1 then this will PROBABLY stop at a DEL (0xff) character in the
file.
The behaviour is actuallu undefined.