This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] operator>>(..., bitset<_Nb>&) failure modes
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Phil Edwards <phil at codesourcery dot com>
- Date: Wed, 03 Dec 2003 17:27:57 +0100
- Subject: [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.