You must keep the number of headers included in any source file (* .cpp, * .cc, etc.) to the minimum necessary to compile this file. Including additional headers will increase compilation time. You should also try to reduce the number of inclusions in your headers - you can do this by translating class declarations rather than including their headers.
eg. The following code has an unnecessary inclusion in the header
Example.hh
#include "SomeClass.hh" void SomeFunction(SomeClass const& obj);
Example.cc
#include "Example.hh" void SomeFunction(SomeClass const& obj) {
You can write how to move include from the header to the source file
Example.hh
class SomeClass; void SomeFunction(SomeClass const& obj);
Example.cc
#include "Example.hh" #include "SomeClass.hh" void SomeFunction(SomeClass const& obj) {
user215269
source share