Hi all,

 

Changing ud-suffix to something other than an identifier would be a significant change to the standard.  It would be necessary to define a specific set of acceptable characters (for example, should emoji & ZWJ be permitted?) with regard to preventing language ambiguities, facilitating future evolution of the language, and ensuring source code readability.

 

I think that ud-suffix­ should continue to be an identifier, and if it that was to change then someone needs to write a paper.

 

In the meantime, people programming in C++ can easily define suffices using standard alphabetical currency codes, e.g. 10500_JPY.

 

Best regards,

 

                Peter

 

P.S. I can’t think of any use-cases where a currency ud-suffix­ is anything other than a horrible idea until we get fixed point or decimal floating point types into C++!  From one of the e-mails underlying the CWG issue:

 

money operator""_ ¢(long double);

 

Friends don’t let friends store currency values in binary floating point. 😉

 

From: SG16 <sg16-bounces@lists.isocpp.org> On Behalf Of Tom Honermann via SG16
Sent: 08 April 2020 04:37
To: sg16@lists.isocpp.org
Cc: Tom Honermann <tom@honermann.net>; Richard Smith <richardsmith@google.com>
Subject: Re: [SG16] Non-identifier characters in ud-suffix

 

EXTERNAL MAIL

On 4/7/20 11:23 PM, JF Bastien via SG16 wrote:

Hi SG16,

 

I'd like you to take on CWG issue #1871:

1871. Non-identifier characters in ud-suffix

Section: 5.13.8  [lex.ext]     Status: extension     Submitter: Richard Smith     Date: 2014-02-17

(From messages 24712 through 247142471624717, and 24719.)

ud-suffix is defined in 5.13.8 [lex.ext] as an identifier. This prevents plausible user-defined literals for currency symbols, which are not categorized as identifier characters.

Rationale (June, 2014):

CWG felt that a decision on whether to allow this capability or not should be considered by EWG.

 

Please let EWG know what you think, given the ongoing TR31 work. EWG will then discuss your proposal, hopefully adopting it as-is, and forward to CWG.

Sounds good.  I filed an SG16 issue (https://github.com/sg16-unicode/sg16/issues/61) to ensure we follow up on this.  We'll discuss at an upcoming telecon.

Tom.

 

Thanks,

 

JF