| List: | Internals | « Previous MessageNext Message » | |
| From: | Mats Kindahl | Date: | June 22 2009 1:43pm |
| Subject: | Re: MySql coding style: Request for deprecation of UPPERCASE typedefs | ||
| View as plain text | |||
Tor Didriksen wrote: > hi > > "Structure types are typedef'ed to an all-upper-case identifier." > Can someone explain the reasoning behind this? > ALL_UPPERCASE_NAME says DANGEROUS_THIS_IS_A_MACRO to me, rather than > struct/class. > > typedef struct foo { ... } FOO; > Is legacy C-style, and does not belong in a C++ style guide (imho). I agree. In addition, it is a problem because there cannot be multiple typedefs, but there can be multiple forward declarations, which makes it very difficult to do a forward declaration of a structure using, e.g.: typedef struct foo FOO; In the event that the header file is included by some other file that does a similar forward declaration, the compiler will throw an error. I would prefer if we never used typedef to introduce aliases for struct/class/union, they cause more problem that it's worth, and they are not needed in C++ at all. Just my few cents, Mats Kindahl > Roy had an email about this: > http://lists.mysql.com/internals/36570 > I could find no objections to his mail, the thread simply died. > > -- didrik > -- Mats Kindahl Senior Software Engineer Database Technology Group Sun Microsystems
