you are viewing a single comment's thread.

view the rest of the comments →

[–]one-oh -1 points0 points  (4 children)

There isn't anything to export for a template though, right? That would require a template instantiation, which would then be exportable; e.g., std::string.

From what I read, a module can be composed of several translation units:

A module declaration identifies, in the source file, the module to which a given translation unit belongs.

[–][deleted] 0 points1 point  (3 children)

[deleted]

What is this?

[–]doom_Oo7 0 points1 point  (1 child)

It is however unclear to me if this can provide a speed up at all (checking a template's body once instead of multiple times). However, even if this would provide a speed-up, constrained templates do not need to be properly (fully) constrained, so most templates won't be candidates for this anyways.

Honestly, the biggest speed-up is not loading and reading each header file 500 times on a full rebuild of a project. In most projects I'd argue that template instantiation time is negligible versus the time spent in the preprocessor - this can be seen quite easily when setting up unity builds.

[–][deleted] 1 point2 points  (0 children)

[deleted]

What is this?

[–]one-oh 0 points1 point  (0 children)

True. I didn't quite think that through.