C++ Logo

SG16

Advanced search

Subject: Re: [SG16-Unicode] code_unit_sequence and code_point_sequence
From: Martinho Fernandes (rmf_at_[hidden])
Date: 2018-06-19 08:33:32


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?


SG16 list run by herb.sutter at gmail.com