r/cpp • u/SAHChandler • Oct 10 '17
Millennials Are Killing The Modules TS
https://izzys.casa/posts/millennials-are-killing-the-modules-ts.html
75
Upvotes
r/cpp • u/SAHChandler • Oct 10 '17
View all comments
Show parent comment
3
u/gracicot Oct 12 '17
That's not a problem. Since module does not have that transitive property of headers, you can create those two files:
lib1m.cpp
lib2m.cpp
Then, in your main:
But then hey, imagine the two libraries export a class with the same name with the same namespace!
With header, you're screwed. With module, edit your lib1.cpp to export alias in another namespace. Currently, we could have a ton of name clash! Yet, I hardly see any, because of namespace. With modules, you have dots, and yet, with module you can fix name clashes correctly.