2 ms·
He fails to note that a pair of underscores appearing anywhere in a name is reserved, not just in leading position. Also, a leading underscore followed by a ca
by moloch-hai 4y ago
He fails to note that a pair of underscores appearing anywhere in a name is reserved, not just in leading position.
Also, a leading underscore followed by a capital letter, or other reserved name, is absolutely allowed in implementation headers -- even in non-standard headers. It is bad practice only because somebody else's compiler (e.g. Clang) might be obliged to read those headers someday, and have invented its own meaning for it.
- mmoll 4y agoAfaik, underscore-underscore anywhere in a name is reserved in C++ only. C only reserves names starting with underscore-underscore. And yes, you can get away with using these identifiers, but you could almost never be certain that you did.
- moloch-hai 4y agoMicrosoft could be absolutely, utterly, undeniably certain it got away with using names reserved to the implementation in its implementation. Arguably some headers are not part of the implementation, because they don't come with MSVS. But that is a matter of packaging, which the Standard does not cover. And, only C++ is of any interest, here. Microsoft never gave a damn about C, and any name reserved in C is also reserved in C++.