C++ Logo

SG16

Advanced search

Subject: Re: [SG16-Unicode] String views with strong code unit types
From: Lyberta (lyberta_at_[hidden])
Date: 2019-06-04 07:14:00


> 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.




SG16 list run by sg16-owner@lists.isocpp.org