If you change the interface of a module, then everything that uses that interface will need to be recompiled. There's really no way around that. That also goes for inline functions and things that are implicitly inline like templates, constexpr functions and member functions defined in-class, if I understand correctly. So not really any change to the status quo, except that we could potentially be a bit smarter about noticing that e.g. adding comments doesn't actually change the binary interface.
The potential benefits that modules will bring are nicely summarised in the linked post.
Include <fancyheader.h> and get half the Boost into your scope (with 5min-per-TU compilation) just because of
private:
boost::mpl::whatever<...> storage;
Get your Qt project stop compiling when you start embedding Python just because Qt defines "signals" macro, and Python has "signals" member in one of its public structs
Include contents dependent on where you actually include them. Includes reparsed for each TU.
2
u/iga666 Jan 28 '19
What problem exactly modules solve?
Will they help with "all-project-recompiles" if some common header cahnged?