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]

Re: [RFC] err |= ios_base::failbit or err = ios_base::failbit?!?


On Tue, Jan 06, 2004 at 12:11:18AM +0100, Paolo Carlini wrote:
> Nathan Myers wrote:
> 
> >The treatment of the "err" argument was meant to match that of the
> >C library's "errno" global -- nothing touches it unless there's an
> >error.  I'd rather see an issue entered to say that num_get<>::get
> >never touches it except to assign failbit.
> >
> I'm not sure to understand what you are suggesting for eofbit, though.
> No changes to the current text (22.2.2.1.2, p13), err |= eofbit?

Sorry, I was hasty.  It is currently correct for the do_get members
only ever to _assign_ a value to err, and never to use operator|=
on it.  That would not change.  

The change (if any) would be in what happens if there is no error.  
Currently, some facets are required to assign "err = goodbit" for 
successful extractions.  I would encourage implementations of
do_get not to touch err in that case, and warn callers to initialize 
properly before calling.   That's already the case for the time_get
facets, and matches the original intent; we should be consistent.

Nathan Myers
ncm@cantrip.org


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