Does:
#include <vector>
#include <string>
#include <winsock2.h>
#include <iphlpapi.h>
#include "FileX.h" <--------------which #include <windows.h>
Compile the same as in one header file:
#include <vector>
#include <string>
#include <winsock2.h>
#include <iphlpapi.h>
#include <windows.h>
In the first case, the windows.h is another file (still included last).
Does something happen different in the compiler between these two ways of including the same headers?
In my world, “FileX.h” is defined as follows
So yes, there “Does something happen different in the compiler” in this case.
Even if it is simply defined as follows, things may be different
If you include too many headers, you may hit the compiler’s resource limit earlier than if you included
<windows.h>directly, and it may hit different paths that may hit different errors in your compiler etc…So it really depends on what you mean by “Does something different in the compiler” at all.