If I put a header (a.h) into stdafx.h and that header includes another header (b.h) that is not mentioned in stdafx.h, will b.h be visited every time someone includes a.h or is it compiled in as part of a.h? If it is compiled into a.h, what happens when someone includes b.h directly? Will this be precompiled or not?
My motivation for asking this question is that I am trying to optimize the content of the stdafx.h files for the software that I work on. Both rebuild and incremental build times are important to us. I was wondering whether I could simply search through all of the .cpp files for #include directives and count the number of times each file is included. Files which were included often might be good candidates for the stdafx.h file. Of course, this strategy is completely bogus if I have to consider not only which files are included, but also which files the included files include.
I doubt it matters, but we are using Visual Studio 2005.