underscore t reserved!

Through a recent stackoverflow question I learned that Posix reserves any identifier ending in “_t”. News to me! I really liked naming my classes starting with a lowercase letter and ending in an “_t”. This permits code like:

     class list_t { };
     ...
     int
     main(int argc, char *argv[])
     {
          list_t list;
     }

This pretty much forces me to start any type in the global namespace with a capitol letter (not my preference). To keep things consistent, that means all my classes/structs will now start with a capitol letter. See here for the posix rules.

Dec 03 2009 05:59 pm | C++ and Posix and Programming | Comments Off

Comments are closed.