3 ms·
It depends on what you are instantiating and how often you're doing so. Most people write templates in header files and instantiate them repeatedly in many many
by SuperV1234 7mo ago
It depends on what you are instantiating and how often you're doing so. Most people write templates in header files and instantiate them repeatedly in many many TUs.
In many cases it's possible to only declare the template in the header, explicitly instantiate it with a bunch of types in a single TU, and just find those definitions via linker.
- jeffbee 7mo agoOn the few times that I have looked at clang traces to try to speed up the build (which has never succeeded) the template instantiation mess largely arose from Abseil or libc++, which I can't do much about.