News for hackers. Stuff that matters.
Re:C++ Modules Might Be Dead-on-Arrival (2019) by lelanthran on Friday December 31, 2021 @04:13AM (#29746257)
> Wait, does the C++ module proposal allow modules names to be different from their filenames?

It sort of makes sense. The calling program specifies `foo.bmi`, but compiling for ARM might look in "armv5/foo.bmi" while targeting x64 might look in "x64/foo.bmi", and that doesn't even take into account that there might be different debug and release versions.

Re:C++ Modules Might Be Dead-on-Arrival (2019) by munch117 on Friday December 31, 2021 @06:37AM (#29747069)
That is very easily solved by not using modules for those things that cause issues, or by using a module facade over traditional C++.

For your example, you could make a 'foo' module that pulls in an implementation from a traditional C++ source file, "armv5/foo_impl.h" or "x64/foo_impl.h", using preprocessor #if/#ifdef to choose the right one. Or you could even use a module backend, pulling in the implementation from either "foo_armv5.bmi" or "foo_x64.bmi".