- 2.1. Header files must begin with the standard C++ file comment.
- 2.2. Then comes the "#ifndef" of the include guard.
- 2.2.1. Guard macro format _<DIR>_<CLASS>_H (all caps).
- 2.3. Then include directives and external class declarations (optional).
- 2.4. Then outside-the-class typedefs (optional).
- 2.5. Then the class definition.
- 2.6. Then other interface declarations (optional).
- 2.7. Then inline function definitions (optional).
- 2.8. Then the "#endif" of the include guard.
$Id:$
.You can choose whatever format for the include guard makes sense for you; I suggest including the directory name, in case the unthinkable happens and your project ends up with two files with the same name. Incidentally, don't use external include guards -- they solve a problem that doesn't exist while cluttering your source files.
Next: header file contents.
No comments:
Post a Comment