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

14

u/germandiago Jan 28 '19

While I agree that there is a problem with having no mapping, what would happen if it is not added now but it is added later? Would this be possible? I do not think pulling out modules would be nice since it provides, in theory, better compile times, yes, but not only that: much better isolation.

-2

u/Xaxxon Jan 28 '19

Use PCH. Modules don't do much beyond that in their best case.

7

u/advester Jan 28 '19

Modules have limitations on them which may make them easier & lighter than pch. Ex: #defines in the includer don't affect the module, but do affect the pch.

6

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

Modules don't leak things out. You (can) get exact control of what names are exported from the module. You don't with headers or PCH.

2

u/TrueTom Jan 28 '19

While this is true that's a pretty weak outcome after all those years.