I know you can export modules like that in C++20:
export module modulename;
And import later as
import modulename;
But can you use filesystem paths in the module system somehow? Something like
import "./modulename.ixx"
I'm using MSVC 19.30.30528 (2022 preview).
Module names are supposed to uniquely identify the module in question. So there are no provisions for specifying "ixx" or any other files. You say what the module name is, and your build system goes looking for modules matching that name. Period.
Importing a quoted string means that you are doing a header unit import. That means it will read the file in question much like you had done a #include and dump all of its symbols into your source file. The difference is that it effectively creates a module in so doing, such that if several files import the same header unit, the system doesn't need to recompile the header unit for each file that imports it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With