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 14:45:01 +0200
On 19.06.18 14:40, Lyberta wrote:
> We can provide deduction guide, for example:
>
> code_point_sequence sps{u"Hello"};
>
> Would deduce to:
>
> code_point_sequence<code_unit_sequence<utf16, std::endian::native,
> std::allocator<std::byte>>>

Ah, so if I initialize code_point_sequence from a string literal, then
code_unit_sequence will be deduced implicitly as the underlying type for
code_unit_sequence?

But doesn't this mean that the user doesn't need code_unit_sequence at
all? *When exactly* would I want to use code_unit_sequence? I still
haven't understood this.

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?

-- 
Martinho

Received on 2018-06-19 14:46:27