Re:Trying out C++20's modules with Clang and Make
by mathstuf on Sunday October 15, 2023 @02:30PM
(#37892114)
Probably because things that don't get "used" can still affect things. There's a lot of detail in name lookup algorithms and SFINAE where computing what you end up using and giving each TU its own view is probably not much savings over using the headers as-is.
Re:Trying out C++20's modules with Clang and Make
by david2ndaccount on Sunday October 15, 2023 @03:23PM
(#37892575)
This works for C, but not C++. And for C, itβs not that hard to do by hand so no one else bothers.
As far as I understand it, they have a tool that can parse all their (C) files, figure out what each file declares and what declarations it depends on, and then autogenerate a header for every file with just the declarations it requires.
It seems like a sensible approach, but nobody besides sQLite and Fossil (which comes from the same developers) seems to be using it, either in C or C++, which leads me to suspect that there are caveats I don't know about. Is there a reason why this is a bad idea?
[1] https://fossil-scm.org/home/doc/trunk/tools/makeheaders.html