[SG16-Unicode] code_unit_sequence and code_point_sequence

Lyberta lyberta at lyberta.net
Tue Jun 19 17:11:00 CEST 2018


Martinho Fernandes:
> Simply "replacing basic_string" isn't enough. If basic_string can fill
> the role intended for code_unit_sequence just fine, then it isn't clear
> at all how this replacement is necessary nor better. So exactly what
> does code_unit_sequence do better than basic_string?
> 

* It has a better name. This will have wide consequences for
teachability of C++ and Unicode in general. People don't understand
Unicode because people who created APIs didn't understand Unicode either
and wanted to cop out by simplifying things. Once we get to std::text,
there will be countless questions about the difference between
std::string and std::text. We can do damage control by deprecating
std::string.
* It handles endianness. std::basic_string understands only native
endianness.
* It will allow us to use better allocator design (if it surfaces fast
enough).
* Not just allocators though, std::basic_string is widely recognized as
one of the worst designed classes in the standard library:

http://www.gotw.ca/gotw/084.htm

We can do better than that.



-------------- 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/0da93cb6/attachment.bin 


More information about the Unicode mailing list