C++17 modules + eliminate redundent compilation of .h - don't improve privacy/modularity - don't solve the fragile base class problem
-
-
Replying to @TimSweeneyEpic
Curious what you'd like on the 2nd bullet. '17 modules (could) prevent unecessary recompiles on private class changes, no?
2 replies 0 retweets 0 likes -
Replying to @ssylvan @TimSweeneyEpic
I.e. just because you added a member, doesn't necessarily mean a recompile if client doesn't ever take the size of the class.
1 reply 0 retweets 0 likes -
Replying to @ssylvan @TimSweeneyEpic
Only with run-time type information with the size in there could you get you around this or if you always called a static i-face to alloc
1 reply 0 retweets 0 likes -
...or whatever i-face as long as the mem alloc happens in the module implementing the type. A very specific case, I think
1 reply 0 retweets 0 likes -
Replying to @heinapurola @TimSweeneyEpic
A lot of code gets a T* does some ops, then forgets it. I.e. never stores it on the stack, in data structs, etc. For that kind of code, ...
1 reply 0 retweets 2 likes -
... changes to the class (even adding members) shouldn't need a recompile. Modules can help make fine grained deps tracking like that work.
1 reply 0 retweets 1 like -
Replying to @ssylvan @TimSweeneyEpic
Yep, most SDKs are built like this. We actually write most our engine interfaces as funcs and opaque pointers...
1 reply 0 retweets 0 likes -
...but I feel that making such a special case rule is dangerous as C++ allows you to do things like offsetof.
1 reply 0 retweets 0 likes -
All offset calculations would have to be run-time coupled with run-time linking and type layout generation.
2 replies 1 retweet 0 likes
Yes, or add one level of vtbl indirection through linker-specified symbols and it could be done without runtime code generation.
-
-
Replying to @TimSweeneyEpic @ssylvan
Would that not imply doing this for all variable accesses? Sounds heavy...
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.