This is the mail archive of the
mailing list for the libstdc++ project.
RE: How do I select a version of libstdc+ to link against?
> If the stream only contains valid booleans, the loop will terminate after
> reaching EOF and trying to extract another boolean, which will set both eofbit
> and failbit.
> The !iss.eof() test isn't quite right though, it will print "fail" for "true true x"
> but it will cause an incomplete value at the end of the stream to be silently
> discarded. So I was wrong to say it will print "fail" for "true true fal", that will
> silently ignore the partial "fal".
> But while(iss>>boolalpha>>b) does give more consistent behaviour between
> 4.1 and 4.4
Thanks Jonathan, I'm happy now.