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 07:22:43


On 19.06.18 14:18, Lyberta wrote:
> Lyberta:
>> code_point_sequence<utf32be> s = ...
>> for (const auto code_unit : s)
>> {
>> std::cout << code_unit << '\n';
>> }
> Sorry, code_unit_sequence of course.

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));

... is simpler than:

code_point_sequence<utf16be> cps(std::move(source));

As far as I can tell the only use for a code_unit_sequence is to pass it
to the constructor of a code_point_sequence.


SG16 list run by herb.sutter at gmail.com