brevzin / cpp_proposals

My WG21 proposals
33 stars 22 forks source link

Unicode-friendly define_class changes. #173

Closed katzdm closed 3 weeks ago

frederick-vs-ja commented 2 weeks ago

~It seems that [lex.name]/1 already imposes stricter requirements on identifiers. Can we just delegate the conditions to that paragaph?~

frederick-vs-ja commented 1 week ago

Sorry for misreading the text. Please ignore the above.

But perphaps we should specify the UTF-8 treatment only when the encoding is not implied by the type (e.g. when the character type is char)?

katzdm commented 1 week ago

Sorry for misreading the text. Please ignore the above.

But perphaps we should specify the UTF-8 treatment only when the encoding is not implied by the type (e.g. when the character type is char)?

Hey @frederick-vs-ja ! Note that this description is only for the informal "design description" of data_member_spec; we haven't yet written our proposed formal wording for the Standard document.

You are right that the purpose of the requirement is to place constraints on the encoding of a buffer of chars. That said, the buffer will either be of chars or of char8_ts. In the case of char8_t, the stipulation isn't really necessary, but seems harmless.