Is it legal to redefine a C++ keyword?
c++, c-preprocessor, keyword, standards
Solution
17.4.3.1.1 Macro names [lib.macro.names]
1 Each name defined as a macro in a header is reserved to the implementation for any use if the translation unit includes the header.164) 2 A translation unit that includes a header shall not contain any macros that define names declared or defined in that header. Nor shall such a translation unit define macros for names lexically identical to keywords.
By the way, `new` is an operator and it can be overloaded (replaced) by the user by providing its own version.
Problem
In this article from Guru of the week, it is said: `It is illegal to #define a reserved word.` Is this true? I can’t find anything in the norm, and I have already seen programmers redefining new, for instance.