5 ms·
Isn't that solved with c++ modules [1]? [1] https://en.cppreference.com/w/cpp/language/modules https://en.cppreference.com/w/cpp/language/modules
by kenniskrag 5y ago
Isn't that solved with c++ modules [1]?
[1] https://en.cppreference.com/w/cpp/language/modules https://en.cppreference.com/w/cpp/language/modules
- pjmlp 5y agoYes, with VC++ offering the best experience currently.
- throwaway2037 5y agoI am confused. Why was this downvoted? Is GCC and Clang doing better? (Or another C++ compiler?)
- Kranar 5y agoBecause the answer is false, modules do not solve the problem of having common/shared template instantiations. As for the comment about MSVC, it's mostly off topic, doesn't relate to the question that was asked (which had nothing to do with which compiler provides the best experience), and even if you accept that MSVC provides the best module experience, it's support for it is still very buggy and not suitable for anything other than experimenting and beta testing.
- Kranar 5y agoNot really, in C++ templates still need to be instantiated in every module but modules don't have to each repeat the parsing of template definitions. The module that declares the template will do the job of parsing the template and producing some intermediate representation of it that other modules can consume. Okay that does save some amount of time but the overwhelming majority of time spent compiling templates is in instantiating them, not parsing them from literal text into an AST. Modules don't make instantiating templates any faster, it only makes parsing them faster.