Header Files
From ScorecWiki
Virtually every .cc file should have an accompanying header file.
[edit]
Include guard
Make sure every header file has an include guard (http://en.wikipedia.org/wiki/Include_guard)
Example:
#ifndef H_FOO #define H_FOO // code goes here #endif
[edit]
Naming and Ordering of Includes
Only include other header files that are used in your header file.
/// C library Includes /// C++ library Includes /// Other libraries .h files /// Your project's .h files
Put forward declarations and using declarations after the includes. In any foo.cc that implements foo.h, put foo.h before any other includes. Within each of the above sections, try to order the includes alphabetically. All your project's code should be in one source directory, and header files should be listed in terms of their path within that directory (Not sure if this is a good idea.). For example, a header file foo.h in src/dir1/dir2, where src is the source directory, should be included as:
#include "dir1/dir2/foo.h"