3 ms·
If compilation speed is an issue, you're already sunk in C and C++ because the #include evaluation rules leave very little room to optimize the massive redundan
by shadowgovt 3y ago
If compilation speed is an issue, you're already sunk in C and C++ because the #include evaluation rules leave very little room to optimize the massive redundancy of computing headers over and over (and every header includes all its headers, and etc).
- uecker 3y agoIn C headers are not a problem. They are simple and effective. C++ made the mistake of putting implementations into headers for generic programming.
- TazeTSchnitzel 3y agoC can have the same problem, it has inline functions.
- uecker 3y agoSure, you could also put a lot of complicated macros into headers. But in practice it is not a problem because this is not how you would do it in C. But in C++ you put the definition of a class into the header. Also templates basically have to exist in headers. So it is normal for C++ code to have a lot of code in headers.