It was suggested to use explicit template instantiation to reduce compilation time. I am wondering how to do it. For example
// a.h
template<typename T> class A {...};
template class A<int>; // explicit template instantiation to reduce compilation time
But in every translation unit where a.h is included, it seems A<int>
will be compiled. The compilation time is not reduced. How to use explicit template instantiation to reduce compilation time?