1. Revision History
1.1. Revision 0
Initial Release 🎉
Despite the vast number of characters now alloted to the C++ standard regarding
identifiers, the one character that is continually seen in extensions is the
$. While some want to permit this as an operator
it is the author’s opinion that it makes more sense to permit it as an
identifier in functions, namespaces, classes, and variables.
While there are some concerns regarding permitting its use in identifiers, this paper does layout a solution for vendors who have supported this extension on some platforms up until now, while also laying a foundation for future characters that exist on all keyboards but might cause linker issues with older platforms.
Additionally, this paper seeks to permit adding both the
the end of member functions. This would permit calls such as
, which could be used to reduce confusion when a function
might be a modifier vs an observer.
While several vendors have permitted the use of the
$ in the past, it is not
able to be supported on all platforms due to linker requirements. While the C++
standard does not have a true notion of "a linker", there is still the reality
that at the end of the day we need to combine our translation units into something. Because of this, this paper takes a unique route for representing
$ in sources. Effectively, we do not add
$ to the basic source
character set. Instead, we permit the preprocessor during the 1st phase of
translation to turn the
$ into its universal-character-name, thus rendering
it into the value
\. Current implementations are then free to mangle the
resulting identifier as though it were a unicode character. For platforms that
$ as an extension, they are free to generate symbols for both
the unicode and
$ literal character.
are part of the basic-execution-set and therefore are being
repurposed for this specific identifier location.
All wording is relative to [N4762].
Note: Wording for the exact changes to permit ! and ? are currently withheld until the San Diego post mailing to see where they should be placed exactly within the grammar.
4.1. ! and ?
Insert into 5.10 Identifiers [lex.name]
Insert into Table 2 in 5.10 Identifiers [lex.name]