The fastest way ... this is not how you should think about it.
fooobar.com/questions/1168512 / ...
I wrote a beautiful (I'm very proud of: P) answer there, talking about how links (with templates) work and proves that it works and what it is, understand it.
The purpose of the #include directives is to create a "translation unit" where each character is declared (even if it is not defined), there is an example in my answer where I just copy and paste the prototype into the code file and not use include.
You do not have to worry about the “fastest” way if you use something called the “Header guard” (they are mentioned briefly below, but this is not detailed enough), they go as follows:
#ifndef __WHATEVER_H #define __WHATEVER_H #endif
So now you can enable "whatever.h" as many times as you want. for the first time, __WHATEVER_H will be defined in the translation module, so the next file that includes it (although many of them include deep from the compiled file) will be empty. since everything between #ifndef and #endif will be missing.
Hope this helps.
Also, if you have unnecessary inputs, use -Wextra and -Wall, GCC will tell you about unused functions, typedef, etc. you can use pragma error push and pop things to control this. For example, wxWidget header files can contain many unused things, so you push warnings onto the stack, delete unused warning flags, include a file, put up a warning stack (turn them back), less you get thousands of warning lines.
source share