Consider the following theoretically simple change:
A definition in a file may not affect headers included after it. If you want global configuration, define them at the project level, or in a header included by all files that need it.
i.e. we need to break this construct:
#define MY_CONFIG=1
#include "header_using_MY_CONFIG.h"
Thats really all we need to do to completely eliminate the nonsense that is constant re-parsing of headers and turn the build process into a task graph where each file is processed exactly one time, and each template is instantiated exactly one time, the intermediate outputs of which can be fully cached.Most real-world large projects already practice IWYU meaning they are already fully compatible with this.
There are some videos by Jonathan Blow on how this is exactly how the Jai compiler is so fast. Why must we still suffer with these outdated design decisions from 50 years ago in C++? Why can't the tech evolve?
/end rant