0

In the codebase I'm working with there are a lot of implicit instantiations of variadic templates like this:

template <typename...Types>
void function(std::tuple<Types...> t);

Explicit template instantiation is reported to help reduce compilation time.

Is it possible to automatically generate a list of all function template instantiations to store them in a dedicated header+source pair to reduce time of subsequent compilation?

Dev Null
  • 4,731
  • 1
  • 30
  • 46
  • what do you mean by "automatically"? the information what instantiations you need later has to come from somewhere – 463035818_is_not_an_ai Aug 24 '18 at 12:26
  • @user463035818 as in I build the codebase in regular mode and somehow extract this list from object files. – Dev Null Aug 24 '18 at 12:28
  • You can list the symbols in the object files in demangled form and then search that for constructors like `::MyTemplate<`. This is all platform specific so that information would help form a more precise answer. – Khouri Giordano Aug 24 '18 at 12:36

0 Answers0