C++ Logo

sg16

Advanced search

Re: [SG16-Unicode] code_unit_sequence and code_point_sequence

From: Martinho Fernandes <rmf_at_[hidden]>
Date: Tue, 19 Jun 2018 15:33:32 +0200
On 19.06.18 15:03, Lyberta wrote:
> Martinho Fernandes:
>> As you said, there are many types out there that would support this
>> concept, some of them already in the standard library. Why do I need a
>> new one, and why would I use it instead of any of the other ones?
>
> Because deducing std::basic_string as a code unit sequence for string
> literals would be bringing an irrelevant broken legacy things such as
> std::char_traits into otherwise extremely clean design.

But why does the user need to know about it? When presented this way,
it's just an implementation detail. When would the user ever actually
want to create and use objects of type code_unit_sequence directly? If
the only use of this class is as backing storage for
code_point_sequence, there is no need for it, especially since, as you
said, there are already plenty of viable alternatives. If you say that
basic_string can do this job just fine, what is a strong motivating
example for adding another specialized sequence container type?

Received on 2018-06-19 15:34:57