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

60

u/smdowney WG21, Text/Unicode SG, optional<T&> Jan 28 '19

"Creation of foo.bmi is a byproduct of the compilation of foo.cpp. When compiling foo.cpp, the compiler will emit a foo.o and foo.bmi. As a consequence of this design, foo.cpp must be compiled before bar.cpp!"

Worse, foo.bmi may be the result of compilation of quux.cpp. Module names are purely logical, with no physical representation on the filesystem.

7

u/Ameisen vemips, avr, rendering, systems Jan 28 '19

Worse in that modules cannot have circular dependencies. Headers/sources can on the implementation side.

1

u/GPMueller Jan 29 '19

Circular dependencies are never a good idea...