Topic: Defect Report: do_in/do_out operation on state unclear


Author: Alberto Barbati <abarbati@iaanus.com>
Date: 26 Dec 02 12:33:18 GMT
Raw View
 [Moderator's note: this defect report has been
 forwarded to the C++ committee. -moderator.]

Hi,

this DR follows the discussion on the previous thread "codecvt::do_in
not consuming external characters". It's just a clarification issue and
not a request for a change.

Section: 22.2.1.5.2 [lib.locale.codecvt.virtuals]

Can do_in()/do_out() produce output characters without consuming input
characters as a result of operation on state?

Proposed resulution:

Add a note at the end of 22.2.1.5.2 [lib.locale.codecvt.virtuals],
paragraph 3:

[Note: As a result of operations on state, it can return ok or partial
and set from_next == from and to_next != to. --end note]

Rationale:

The submitter believes that standard already provides an affirmative
answer to the question. However, the current wording has induced a few
library implementors to make the incorrect assumption that
do_in()/do_out() always consume at least one internal character when
they succeed.

The submitter also believes that the proposed resolution is not in
conflict with the related issue 76. Moreover, by explicitly allowing
operations on state to produce characters, a codecvt implementation may
effectively implement N-to-M translations without violating the "one
character at a time" principle described in such issue. On a side note,
the footnote in the proposed resolution of issue 76 that informally
rules out N-to-M translations for basic_filebuf should be removed if
this issue is accepted as valid.



-----= 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                       ]