Topic: About LWG issue 76 (Can a codecvt facet always convert one internal
Author: abarbati@iaanus.com (Alberto Barbati)
Date: Sun, 12 Jan 2003 19:27:54 +0000 (UTC) Raw View
Hi,
I have one remark about LWG issue 76. I agree with the rationale and the
direction of the proposed solution, but it seems to me that the proposed
wording about do_in is incorrect. It says:
---
A codecvt facet that is used by basic_filebuf (27.8 [lib.file.streams])
must have the property that [snips] if
do_in(state, from, from_end, from_next, to, to_lim, to_next)
would return ok, where to != to_lim, then
do_in(state, from, from_end, from_next, to, to + 1, to_next)
must also return ok.
---
Suppose to_lim - to > 1 (otherwise the two calls are identical). The
fact that the first call returns ok means that all characters of the
"from" sequence can been converted. The conversion may require several
"to" characters, but we are _supposing_ that the "to" sequence is large
enough allow the conversion.
Now, in the second call you reduce the "to" sequence to one single
character. By _requiring_ the call to still return ok, we are requiring
that the *whole* "from" sequence can indeed be converted to one single
character. How can this requirement be met?
I suggest to change the proposed wording to something like this:
---
[snips] if
do_in(state, from, from_end, from_next, to, to_lim, to_next)
would return either ok or partial and set to_next != to, then
do_in(state, from, from_end, from_next, to, to + 1, to_next)
must return either ok or partial and set to_next = to + 1.
---
Regards,
Alberto Barbati
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]