LCA: Lessons from 30 years of Sendmail
Posted Feb 7, 2011 19:13 UTC (Mon) by
nix (subscriber, #2304)
In reply to:
LCA: Lessons from 30 years of Sendmail by cmccabe
Parent article:
LCA: Lessons from 30 years of Sendmail
You seem to be confused about how include files work in C and C++. The way they work is that each translation unit (that's .cpp file to you) has to scan through all the files included by that unit, recursively. There are no shortcuts and the compiler cannot cache this work.
Except that there
are shortcuts and GCC
does cache this work, and has for more than fifteen years. (e.g. you can skip even opening files more than once if they are entirely contained in include guards and the guards are not #undefed.)
(
Log in to post comments)