C++ Logo

sg16

Advanced search

Re: [SG16-Unicode] code_unit_sequence

From: Lyberta <lyberta_at_[hidden]>
Date: Tue, 16 Jul 2019 22:25:00 +0000
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.


Received on 2019-07-17 00:25:44