r/cpp • • Jan 28 '19

C++ Modules Might Be Dead-on-Arrival

https://vector-of-bool.github.io/2019/01/27/modules-doa.html
280 Upvotes

240 comments sorted by

View all comments

2

u/iga666 Jan 28 '19

What problem exactly modules solve?

Will they help with "all-project-recompiles" if some common header cahnged?

4

u/tcbrindle Flux Jan 28 '19

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.

1

u/cassandraspeaks Jan 30 '19

IIRC there are some subtle differences between inline and non-inline templated functions.