[SG16-Unicode] code_unit_sequence and code_point_sequence
Lyberta
lyberta at lyberta.net
Tue Jun 19 14:40:00 CEST 2018
Martinho Fernandes:
> But this just makes the example convince me that code_unit_sequence is
> even less useful. If I understood correctly you wanted to show that
> supporting utf32be in code_point_sequence makes things more complicated
> for the user. Correct me if my understanding of the interface is wrong,
> but, roughly, I don't think I can be convinced that:
>
> code_unit_sequence<utf16, big_endian> cus(std::move(source));
> code_point_sequence<utf16> cps(std::move(cus));
code_point_sequence takes container as the first parameter so the second
line of code will be just:
code_point_sequence cps(std::move(cus));
We can provide deduction guide, for example:
code_point_sequence sps{u"Hello"};
Would deduce to:
code_point_sequence<code_unit_sequence<utf16, std::endian::native,
std::allocator<std::byte>>>
Remember there are tons of code unit sequence types out there:
std::basic_string, Microsoft's CString, Qt's QString, wxWidgets's
wxString. We want to support all those types if people provide their
encoding form traits.
-------------- 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/20180619/0d2176a9/attachment.bin
More information about the Unicode
mailing list