We have a big class with multiple template parameters. To cut down on compile time, we are already using explicit instantiatiation. While this reduces the compile time of everyone who includes the header, compiling the cpp file is still super slow.
Is there any way to tell the compiler (here: gcc and clang) to instantiate multiple templates in parallel?
We would like to have the same effect as putting template class Foo<T1>;
and template class Foo<T2>;
from the linked question into two different cpp files.
Since there are multiple cases of Foo
and multiple different instantiations, having to maintain a file for each is not optimal. Also, the explicit instantiation as seen above is generated by a macro.