C++ Logo


Advanced search

Re: [SG16-Unicode] code_unit_sequence and code_point_sequence

From: Martinho Fernandes <rmf_at_[hidden]>
Date: Tue, 19 Jun 2018 14:22:43 +0200
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.

Received on 2018-06-19 14:24:08