[RFC] libstdc++/7220
Paolo Carlini
pcarlini@unitus.it
Sat Jul 6 10:45:00 GMT 2002
Hi,
the following testcase, distilled from the PR, passes with 3.0.4 (and
Dinkum), doesn't with 3.1 and current v3:
#include <sstream>
#include <cassert>
#define Is std::basic_istream<char,std::char_traits<char> >
#define It std::char_traits<char>
#define Al std::allocator<char>
int main(int, char *[])
{
int res = 0;
std::streamsize n;
std::basic_string<char,It,Al > input((const char *)"abcdefg\n");
std::basic_stringbuf<char,It,Al > sbuf(input);
std::basic_istream<char,It > istr(&sbuf);
istr.ignore(0, (Is::int_type)'a');
assert( istr.gcount() == 0 );
return 0;
}
In your reading of the standard (27.6.1.3, 24), how ignore is supposed
to behave in this case? When count == 0, and the next char is the
delimiter ('a'), must it be eaten anyway or not?
Ciao, Paolo.
More information about the Libstdc++
mailing list