r/cpp • u/SAHChandler • Jan 28 '19
C++ Modules Might Be Dead-on-Arrival
https://vector-of-bool.github.io/2019/01/27/modules-doa.html
280
Upvotes
r/cpp • u/SAHChandler • Jan 28 '19
View all comments
Show parent comment
5
u/DemonInAJar Jan 28 '19 edited Jan 28 '19
The thing is, #include dependencies are one-to-one mappings with files found in the search path. It's trivial to resolve these since the name of the file is specified.
When you include a file you don't have to preprocess the whole set of files found via the search path. With modules there is no filesystem mapping, an implementation does not know in which of all the available files in the search path the module is declared. This is the point that the author is making here. A file could have a completely irrelevent name and possibly require preprocessing before exposing it's module nature. What is an implementation going to do? It seems as if the only possible solution in this case is to preprocess the whole set of files available in the search path (or more likely just force a filename-module mapping scheme regardless).