r/cpp • u/holyblackcat • Mar 09 '26
The compilation procedure for C++20 modules
https://holyblackcat.github.io/blog/2026/03/09/compiling-modules.html
105
Upvotes
r/cpp • u/holyblackcat • Mar 09 '26
View all comments
Show parent comment
2
u/ABlockInTheChain Mar 10 '26
Without forward declarations, two types defined in two headers in two separate subdirectories can not refer to each other in any way whatsoever.
There surely must be coding practices where that restriction is not a problem because the situation never occurs and for the users of those won't have any issues with modules.
For others this restriction breaks too much and thus as long as modules impose this restriction they will not be adopted.
Because very few people use modules very few people are encountering this defect in the standard and so there is no pressure to fix it.
Since modules weren't even usable enough to experiment with nobody complained enough to get the issue of missing proclaimed ownership declarations for C++23.
Now it's also too late for C++26.
The earliest opportunity to ship a viable module standard is now C++29 and who knows if it will even happen then.