Functions that are called from lots of different places are usually important, and justify having documentation written for them. In particular, if a function is defined in a file, and is called from at least two other files, then the function should probably be documented.

As an exception, because their purpose is usually obvious, it is not necessary to document constructors, destructors, implementations of operator=, or functions with fewer than five lines of code.

Add comments to document the purpose of the function. In particular, ensure that the public API of the function is carefully documented. This reduces the chance that a future change to the function will introduce a defect by changing the API and breaking the expectations of the calling functions.

  • C++ Programming Wikibook: Comments
  • Wikipedia: Need for comments