C++ Logo

std-proposals

Advanced search

Re: [std-proposals] P3695R0 Deprecate implicit conversions between char8_t, char16_t, and char32_t

From: Hans Åberg <haberg_1_at_[hidden]>
Date: Fri, 16 May 2025 22:55:40 +0200
> On 16 May 2025, at 22:41, Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
>
> On 16/05/2025 22.20, Hans Åberg wrote:
>>
>>> On 16 May 2025, at 21:15, Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
>>>
>>>> Possibly, implicit conversions between char8_t and char32_t cause problems here.
>>>
>>> How so? Why would the presence or absence of a conversion between T and U
>>> affect the design space of supporting or not supporting a conversion between
>>> some_class<T> to some_class<U>?
>>
>> If one is using explicit char8_t which gets converted into std::u32string, but perhaps this is not a problem.
>
> Which example do you have in mind, specifically? I'm not finding a constructor
> that would enable such a conversion, at this moment.

Right. And I have not found char8_t associated types particularly useful for the lack of higher-level conversions, so I can't think of any good examples. :-)

But as for the paper, it seems good to deprecate implicit char8_t to char32_t conversions. If one is using explicit Unicode code points, only char32_t makes sense.

Received on 2025-05-16 20:55:55