I love the rest of the changes, but that just doesn't sit right with me.
I love the rest of the changes, but that just doesn't sit right with me.
The standard can't use commas as a separator because using commas vs periods to demarcate components is locale specific. Apostrophes look like a reasonable compromise because lots of calculators already use apostrophes to separate digits:
https://www.google.com/search?q=14+digit+calculator&source=l...
Dunno why they didn't use underscores though.
For example, the "->" was already an operator for pointer indirection but it was reused for lambda definitions. The "[]" was already used for array subscript indexes but was reused for lambda captures.
Or, they could have defined C++14 to simply invalidate your example syntax of "x=1,2". As an example, the "auto" keyword was made a "breaking change" such that "for (auto int i = 0;;)" no longer compiles.
The bottom line is that there are a myriad of ways to address (potential) parsing ambiguities when introducing new language features and syntax. (Whether or not a comma digit separator is worth the clumsier syntax of a special prefix or inflicting the pain of a breaking change is a separate concept.)
As an example, your proposed solutions
_1,000,000
k1,000,000
Both are already valid if variables or functions _1 or k1 are in scope, and evaluate to (octal) zero.And I haven't checked, but it would guess that invalidating "x=1,2" in the parser would not be "simple". I cannot think of a reason, but it also might turn out to be more common then one would think due to macro expansions.
I stand corrected.
So instead of 1,234.56789 (English) or 1.234,56789 (French) we do 1 234.56789 (international)
[0-9]+ [0-9]+ has no meaning in C++, so using space for magnitude decorations would have worked.