C++ Logo

sg16

Advanced search

Re: [SG16-Unicode] code_unit_sequence and code_point_sequence

From: Lyberta <lyberta_at_[hidden]>
Date: Tue, 19 Jun 2018 15:11:00 +0000
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.




Received on 2018-06-19 17:11:24