Discussion Overview
The discussion revolves around whether C++ compilers repeatedly process the same header files during compilation, particularly in the context of multiple .cpp files including the same .h files. The scope includes technical explanations and potential compiler optimizations.
Discussion Character
- Technical explanation, Debate/contested
Main Points Raised
- One participant asserts that C++ compilers compile the same .h files multiple times when processing different .cpp files.
- Another participant counters that some compilers, specifically Visual compilers, utilize precompiled headers to optimize compilation time and resource usage.
- A later reply questions the necessity of precompiled headers and suggests that the ability to enable or disable this feature may depend on the specific compiler being used.
- One participant confirms that the feature can be toggled on or off as desired.
Areas of Agreement / Disagreement
Participants express differing views on the behavior of C++ compilers regarding header file processing, with some supporting the idea of repeated processing and others advocating for the use of precompiled headers as a solution. The discussion remains unresolved regarding the extent to which compilers handle header files consistently.