[SG16-Unicode] String views with strong code unit types

Lyberta lyberta at lyberta.net
Tue Jun 4 14:14:00 CEST 2019


> Something like this, or did I misunderstand what you're after?
> 
> (Requires non-portable GCC extensions)
> 
>> https://gcc.godbolt.org/z/Evi5rD

Yep, that's exactly what I want.

> That literals aren't required to be well formed is a subset of the problem
> that char8_t data may have come from anywhere and can't be assumed to be
> well formed. Real world text is frequently broken.

Sure but in my library I try to enforce as much well formedness as
possible. For example my utf-8 code units can't store values 0xC0, 0xC1
and 0xF5-0xFF.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://www.open-std.org/pipermail/unicode/attachments/20190604/b81ac171/attachment-0001.bin 


More information about the Unicode mailing list