3 ms·
I once thought about an automatic bullet-proof precompiled-header system. I think this is actually not impossible to implement. When first parsing a header, th
by albertzeyer 14y ago
I once thought about an automatic bullet-proof precompiled-header system. I think this is actually not impossible to implement.
When first parsing a header, the parser can take track about all macros it depends on in the preprocessor state. E.g. a very common macro is the one it reads very first, like `#ifndef __MYFILE_H`.
Then, including a header becomes a function (<macro1, macro2, ...>) -> (parser state update, i.e. list of added stuff). This can be cached.