On 10/21/18 4:39 PM, Ed Smith-Rowland wrote:
All,

This patch implements C++2a proposal P0330R2 Literal Suffixes for ptrdiff_t and size_t*.  It's not official yet but looks very likely to pass.  It is incomplete because I'm looking for some opinions. (We also might wait 'till it actually passes).

I don't mind putting it in before it passes so long as you keep track of the proposal's progress -- I just discovered that the string UDL template proposal we implemented for C++14 wasn't actually accepted, so we need to pedwarn about it.

This paper takes the direction of a language change rather than a library change through C++11 literal operators.  This was after feedback on that paper after a few iterations.

As coded in this patch, integer suffixes involving 'z' are errors in C and warnings for C++ <= 17 (in addition to the usual warning about implementation suffixes shadowing user-defined ones).

OTOH, the 'z' suffix is not currently legal - it can't break currently-correct code in any C/C++ dialect.  furthermore, I suspect the language direction was chosen to accommodate a similar addition to C20.

I'm thinking of making this feature available as an extension to all of C/C++ perhaps with appropriate pedwarn.

Opinions?

That seems reasonable to me, but Joseph will need to weigh in about C.

Jason

Reply via email to