It was suggested to use explicit template instantiation to reduce compilation time. I am wondering how to do it. For example
// a.h template
Declare the instantiation in the header:
extern template class A;
and define it in one source file:
template class A;
Now it will only be instantiated once, not in every translation unit, which might speed things up.