Am 06.04.2022 um 01:15 schrieb Niall Douglas via Boost:
On 05/04/2022 23:56, Peter Dimov via Boost wrote:
Niall Douglas wrote:
The compiler will automatically as-if do the above for you if Modules are enabled for standard library headers. It's clever enough to interpret an include as an import. So no need.
Right, but this part of the standard is optional. MSVC has it but not the others, right? clang has it too. Clang doesn't even seem to support `import <iostream>;` yet. It's been a while since I last tried it, but clang has a structure of module maps and they indicate what is what.
If libc++ aren't building <iostream> as a module, I assume they have good reason for that. Any automatic reinterpretation of #include into import has nothing to do with how good - or bad - the actual module implementation is, or what is supported and is not supported.
If clang doesn't treat *all the standard C++ library headers* as importable and actually supports compiling them as header units, then they're simply not standards compliant in this regard. Supporting automatic include translation for them is the optional cherry on top of compliance. Supporting other headers as importable and provide include translation for them is encouraging, though. Ciao Dani