C++ Logo

sg16

Advanced search

Re: Follow up on SG16 review of P2996R2 (Reflection for C++26)

From: Peter Dimov <pdimov_at_[hidden]>
Date: Tue, 30 Apr 2024 01:38:46 +0300
Corentin Jabot wrote:
> 4, and 5 are inventing a new "portable" encoding.
> One that is portable to a couple functions of C++ but not for example a python
> binding generator. Or any other library in C++ or in another language, nor any
> tool.
> While it does solve the problem of technically not producing mojibake, it also
> fails to solve the problem in a meaningful, user-friendly way.
>
> Overwhelmingly identifiers will be basic characters. When they aren't,
> whoever gets an error in python or javascript that \ is not a valid identifier will
> have a surprise.
> Moreover, I'm extremely opposed to producing runtime strings that mirror
> lexing elements; it is just too confusing to teach to people.

But they (4 and 5) do have the advantage of being no-ops when the literal
encoding is UTF-8, so we get what we want - perfectly legal char[] strings in
UTF-8, everything works.

Received on 2024-04-29 22:38:50