C++ Logo

sg16

Advanced search

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

From: Tom Honermann <tom_at_[hidden]>
Date: Mon, 29 Apr 2024 17:30:20 -0400
On 4/29/24 4:15 PM, Peter Dimov via SG16 wrote:
> Tom Honermann wrote:
>> Here is another option:
>>
>> 1. Require that consumers of names like data_member_spec() accept
>> UNC-like encoded characters (UNC-like because these wouldn't actually be
>> UNCs).
>> 2. Require that producers of names like name_of() only generate a UNC-
>> like encoded character when the associated (ordinary/wide literal) encoding
>> lacks representation for the character.
> That's probably not half bad, however (2) needs to also encode when the
> string contains the (fully representable) sequence \u or \U.

Good point. I don't think that actually matters in this case though
since "\" isn't valid in an identifier and shouldn't appear as any part
of a qualified or display name (encoded, descriptive, or otherwise).
Certainly worth a note at a minimum though.

Tom.

Received on 2024-04-29 21:30:23