C++ Logo

sg16

Advanced search

Re: [SG16-Unicode] code_unit_sequence

From: Steve Downey <sdowney_at_[hidden]>
Date: Wed, 17 Jul 2019 17:55:17 -0400
What interfaces is utf8_code_unit likely to appear in? I'm not sure I see
the value in a strong type here, whereas I can see it for code_point and
scalar_value. I expect most conversion operations to translate from untyped
raw data, most likely byte, char, or char8_t, directly to code_point or
scalar_value? There's some special cases for utf-8 / 16 conversions, but
those are still likely to be on parts of raw buffers or in the vicinity of
OS interfaces. At least that's been my experience.


On Tue, Jul 16, 2019 at 6:25 PM Lyberta <lyberta_at_[hidden]> wrote:

> JeanHeyd Meneide:
> > I'm a bit curious: what does std::code_unit_sequence<char8_t> offer us
> that
> > std::vector<char8_t> wouldn't? Is there something special we can do with
> > code_unit_sequence (i.e., treat it like a string?) that we couldn't do
> with
> > std::vector<char8_t> here? I'm trying to figure out what having a
> > std::vector alias buys us in terms of compile-time interface.
>
> Small buffer optimization. Yes, this is not reflected in API, we'll have
> to reflect it in wording. Also, it's not char8_t, it's
> std::unicode::utf8_code_unit. It is a strong type that can only be
> explicitly constructed from char8_t.
>
> I intend to make it possible to give std::vector or 3rd party class with
> the same API to higher levels but haven't tested this yet.
>
> _______________________________________________
> SG16 Unicode mailing list
> Unicode_at_[hidden]
> http://www.open-std.org/mailman/listinfo/unicode
>

Received on 2019-07-17 23:55:31