I am pretty sure that it is a bad practice to add another include guard like:
#ifndef __HEADER_A_HPP__
#include "header_a.hpp"
#endif
Here are some reasons why:
-
To avoid double inclusion it is enough to add a usual include guard inside the header file itself. It does the job well. Another include guard in the place of inclusion just messes the code and reduces readability.
-
It adds unnecessary dependencies. If you change include guard inside the header file you have to change it in all places where the header is included.
-
It is definitely not the most expensive operation comparing the whole compilation/linkage process so it can hardly reduce the total build time.
-
Any compiler worth anything already optimizes file-wide include-guards.