News for hackers. Stuff that matters.
Re:Building and Linking Libraries in C by swift on Thursday December 22, 2016 @11:02PM (#13242739)
Instantiating the templates at link time would probably make more sense. With LTO we're already deferring a significant portion of the compilation process to link time so this is an obvious extension.

This issue was also on the mind of the C++ standards committee when they began work on the new module system. I'm not sure how the current spec behaves with respect to template instantiation, though.

Re:Building and Linking Libraries in C by dfox on Friday December 23, 2016 @06:02AM (#13244165)
C++98 contained some provisions for that ("export template"), but anecdotally there is exactly one compiler that supports it and the whole mechanisms was found to cause more problems than it solves. See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n142...

Problem with template instantiation is that the mechanism is too general to be amendable to some kind of meaningful precomputation.