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: [PATCH] Support stateful encodings in basic_filebuf


On Mon, Nov 03, 2003 at 11:41:41PM -0600, Benjamin Kosnik wrote:
> 
> Nice work. Two small comments:
> 
> >1) Call codecvt::unshift() from close(), seekoff and seekpos iff
> >   _M_writing is true. Note that this is not what the standard says,
> >   but it has the benefit that the written file can actually be read
> >   again.
> 
> This is the only part of the patch that I'm a bit uneasy about...

Those bits are necessary to meet the requirements, on stateful 
encodings, that we inherit from C: all sequences must begin and end 
in the ground state.  Users have no other way to establish the end 
of sequence state, even assuming they know the encoding is stateful.  

Without those bits, there would be little point in adding any support
for writing stateful encodings.

Nathan Myers
ncm-nospam@cantrip.org


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