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

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Jun 4 13:07:12 CEST 2019


Hi,

Il 04/06/19 09:38, Lyberta ha scritto:
> I'm trying to replicate a "sv" UDL with strong code unit types.
> 
> constexpr auto operator "" _cus(const char8_t* literal, std::size_t size)
> 
> As view types require some outside storage, I'm will need to create an
> array of code units in static memory. I'm not sure how to do that. Also,
> the compiler says that "size" is not a constant expression. Any ideas?

Something like this, or did I misunderstand what you're after?

(Requires non-portable GCC extensions)

> https://gcc.godbolt.org/z/Evi5rD


Best regards,

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
Url : http://www.open-std.org/pipermail/unicode/attachments/20190604/f42c5f5e/attachment.bin 


More information about the Unicode mailing list