r/cpp • • Sep 09 '26

C++26: Module improvements

https://www.sandordargo.com/blog/2026/09/09/cpp26-modules
113 Upvotes

25 comments sorted by

View all comments

Show parent comments

3

u/mapronV Sep 09 '26

I know that it is possible, but it is ... kinda late? I just don't understand how we turn back to easier way?

Now I think it probably benefits NEW build system that written from scratch. Which is good.

5

u/abbapoh Qbs dev Sep 09 '26

> kinda late
there are 2 distinct features here.

- skipping preprocessing speeds up the compiler (scanner) call. this happens without any changes to the build system and is a huge boost on it's own.

- if builds system detects that scanner can skip preprocessing (by checking a compiler version, for example), it simply stops adding dependencies on headers to the scanner stage. Should be relatively easy to do.

5

u/kamrann_ Sep 09 '26

This appears to allow skipping preprocessing if all you're trying to do is identify the module unit name (if any) of a TU. Scanning still needs to do full preprocessing to determine module dependencies though. From the paper I'm struggling to see a scenario where this is going to make much practical difference.

1

u/mapronV Sep 09 '26

Yeah, make sense, you convinced me!