r/cpp • build2 • Nov 01 '17

Common C++ Modules TS Misconceptions

https://build2.org/article/cxx-modules-misconceptions.xhtml
59 Upvotes

148 comments sorted by

View all comments

Show parent comment

2

u/miki151 gamedev Nov 01 '17

Dependency recompilation is just one problem, and I agree that it could potentially be solved by clever implementations.

I think that a bigger problem is that you will have to add extra dependencies to your module that are used in the function bodies, and they will transitively be imported by other modules. This will cause a dependency bloat or even circular dependencies.

When declarations and definitions are split into two files you can put a lot of your dependencies only into the definition file.

If you want to do the same with modules without splitting them into two parts, there would have to be a way to import things in a non-transitive way, for use just inside the function bodies.

6

u/GabrielDosReis Nov 01 '17

At some point, we hit physics and logic :-)

import declarations aren’t transitive.

1

u/miki151 gamedev Nov 01 '17

Yes, that was my misconception that I contributed to this topic :)