3 ms·
Not 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
by Kranar 5y ago
Not 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.