3 ms·
Shadowing keywords is perfectly valid, although I believe you can't shadow keywords in standard headers so that compiler writers don't need to worry about it. I
by 30thElement 13y ago
Shadowing keywords is perfectly valid, although I believe you can't shadow keywords in standard headers so that compiler writers don't need to worry about it. It gives rise to some "useful" C/C++ features that should never be used, like if you want to access private members in foo.cpp, do
#define private public
#include "foo.cpp"
#undef private
- TazeTSchnitzel 13y agoI can imagine some insidious menace adding this to the top of a file: #define public protected
- yoklov 13y agoI once someone jokingly do (the second only always works in C, not C++) #define else #define struct union Evil!