Friday, February 23, 2007

C++ - Minimize Dependencies

A change in a header file (.h, .hpp) causes every other header file that includes it to be recompiled. Thus, to decrease incremental build times, strive to minimize the number of #include's in header files.

Note this cannot be done with every header file, such as files containing dependencies on template classes or typedefs.

No comments: