Large file iostreams
Nathan Myers
ncm-nospam@cantrip.org
Sat Sep 6 06:47:00 GMT 2003
On Thu, Sep 04, 2003 at 06:23:46PM -0600, Martin Sebor wrote:
>
> ... our own
> implementation uses mbstate_t values that have nothing to do
> with those used by the C library (we still use mbstate_t() to
> denote the initial shift state).
>
> I think that the intent (Nathan could clarify this) must have
> been that C++ codecvt be (possible to be) implemented in terms
> of the C multibyte functions. Otherwise I don't see why even
> specify mbstate_t in C++ locale and not some completely
> unrelated state type.
On the contrary. It was specifically intended that better
implementations would _not_ use the C multibyte functions. (Indeed,
I personally expected that the better implementations would have their
own versions of the C functions built on top of the C++ library
features. That seems still to come.)
Since it was clear that some implementations would need to use the
C functions, we chose to use mbstate_t to hold the state to make
that choice easier to implement. In retrospect it was probably a
mistake not to have abstracted it, as it has made it harder to make
a C++ library portable across C libraries.
Nathan Myers
ncm-nospam@cantrip.org
More information about the Libstdc++
mailing list