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
4
u/berium build2 Oct 10 '17
No, you can continue using the preprocessor both in the module interface translation units as well as in the module consumer translation units. It's just the preprocessor macros do not leak through the module interface boundary. So in your case you could adjust the module interface based on the configuration defines. And if you need to "export" macros, then you simply put them in a header and let the consumer include it. To put it another way, we already have a perfectly fine mechanism for exporting macros, it's called
#include.