This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]