
25 Aug
2005
25 Aug
'05
10:42 a.m.
Rupert Kittinger wrote:
In the tuple_io.hpp header, there seems to be a slight problem in extract_and_check_delimiter(). The following snippet is problematic:
char c; if (is_delimiter) { is >> c; if (c!=d) { is.setstate(std::ios::failbit); } }
If c cannot be read because is.eof(), the result of c!=d is undefined.
IMHO the fix is neater as: if (is>>c && c!=d) basic_ios::operator void*() exists to support this syntax rather than explicitly testing the state with good(), fail() etc. jon