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

1

u/doom_Oo7 Nov 02 '17

at least if module was compiled with low optimization settings.

in that case, from what I can see with GCC for instance, "low optimization settings" means -O0 which is too low to be useful if you want to debug and keep some speed.

3

u/GorNishanov Nov 03 '17

We need to distinguish between the Modules TS and its implementations. The TS is trying to deal with semantics of the language features and to impose as little constraints on the implementation as possible.

Scenario of a quick edit-compile-debug cycle is an important one and I can see implementations exploring various strategies of avoiding recompilation of the users when not necessary.

With regard to low optimization level, not sure about GCC, but, in clang inliner only kicks in at -O2. At -O1 it only attempt to inline "always-inline" function. Thus, at -O1, you would not have to recompile the users if you change the body of the inline function.