In C++20 it is possible to instead of include headers with
#include "header.h"
use
#import "header.h" // Edit: this is not standard see comments
(this is for old code that cannot fully be converted to modules and use the normal import keyword without #)
My question is about preprocessing. For a long time it as only been possible to precompile and use one header per translation unit. (Clang seems to have some special case with cascading include files, that I do not consider here)
Will it be possible to precompile and use multiple header files per translation unit with the #import
keyword, now that the header files can be somewhat isolated?
Edit:
So my misunderstanding of this seemed to be from the fact that, when enabling modules in for example g++, using #include "..."
turns into import ""
automatically (I think).
I found this video Nathan Sidwell “Converting to C++20 Modules” where Nathan explains how to precompile "header units", in what I guess is the modules branch in g++, but it does not seem to work in clang++-10. I don't know if this is something that will work on other compilers as well.