6 ms·
IOD comes with example code using identifiers such as _Name. AFAIK all C and C++ standards reserve all identifiers starting with _[A-Z] as well as those startin
by _yosefk 12y ago
IOD comes with example code using identifiers such as _Name. AFAIK all C and C++ standards reserve all identifiers starting with _[A-Z] as well as those starting with __ for compiler use (and I've seen people complain about it a couple of times - about a decade ago someone was hit by a new gcc version #defining _Y, and recently someone else got hit by a more recent gcc version #defining _X, on some platforms but not others...)
So I think a different convention (Name_, _name, etc.) would be better to use in example code, so that people don't learn a convention that might byte them down the road.
- matt42 12y agoThanks. I was not aware of this rule. I will change this convention as soon as possible. It is a bit strange that g++ did not report any warning...