Hacker News new | ask | show | jobs
by intea 2791 days ago
C++ compilation is massively slowed down by the sheer existence of the preprocessor. This could be drastically improved by the usage of modules which are coming soon(tm).

Both MSVC and Clang already support them experimentally fwiw.

1 comments

To be fair, what slows down compilation is not "the sheer existence" but the extensive use of large and complex #include files.
Indeed. IIRC this topic is covered directly in Meyers' "Effective C++" book, including the trick to use pointers + forward declarations in headers to avoid including other headers.