Topic: codecvt<>
Author: "Martin Connell" <topology@btinternet.com>
Date: 1997/11/10 Raw View
The documentation for the codecvt<>::do_length() method is inconsistent
between library implementations (PJPlauger and Rogue Wave) and the standards
document at
http://www.slac.stanford.edu/BFROOT/doc/Computing/Standards/C++/cd2/ .
There is also a discrepancy between PJPlauger s documentation and his
implementation: the implementation reflecting not his own documentation but
more-or-less the CD2 description of the method. But even here there is a
discrepancy as the the prototype of the method is FUNDAMENTALLY different
between the standards document and the PJP and Rogue Wave implementations,
as detailed below:
PJP & RW:
template<class internT, class externT, class stateT>
class codecvt : public locale::facet, public codecvt_base {
...
virtual int do_length(stateT&, internT*, // <-- taking internT
const internT *, size_t) const throw();
...
};
CD2 document (22.2.1.5):
template<class internT, class externT, class stateT>
class codecvt : public locale::facet, public codecvt_base {
...
virtual int do_length(stateT&, externT*, // <-- taking externT
const externT*, size_t) const throw();
...
};
NB: if you can t spot the difference, its that the former do_length() method
is taking internT (the first template argument), and the latter do_length()
is taking externT (the second template argument).
Can anyone shed any light on this? What would also be wonderdul would be a
once-and-for-all definitive breakdown of exactly what this method should do
(in the old style of describing the input and output), and how it is
intended to be used in the context of stream conversion etc.. I would be
extremely grateful for any feedback.
Regards,
Martin Connell
[ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
[ about comp.lang.c++.moderated. First time posters: do this! ]