[RFC] operator>>(..., bitset<_Nb>&) failure modes

Paolo Carlini pcarlini@suse.de
Wed Dec 3 16:27:00 GMT 2003


Hi everyone, hi Phil,

I'm working on implementing the resolution of DR 303 and noticed
something that seems wrong to me:

      if (__tmp.empty() && !_Nb)
        __state |= ios_base::failbit;

Phil, this changed from the simple 'if (__tmp.empty())' in May 2002,
with the Changelog entry:

(operator>>): If nothing was extracted, don't fail in the
zero-length case.

Shouldn't therefore be:

      if (__tmp.empty() && _Nb)
                           ^^^---------------- *not* negated!
        __state |= ios_base::failbit;

instead???

Thanks,
Paolo.



More information about the Libstdc++ mailing list