[SG16-Unicode] code_unit_sequence and code_point_sequence

Martinho Fernandes rmf at rmf.io
Tue Jun 19 14:45:01 CEST 2018


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


More information about the Unicode mailing list