A function or class template can be explicitly instantiated as extern. This prevents implicit instantiations: any code that would’ve implicitly instantiated the template would now have to use an explicit instantiation provided somewhere else in the program.

template <typename T>
void foo(T) {}
 
template <typename T>
class Foo {};
 
// After this delaration, foo<int> will not be implicitly instantiated,
// it will rely on it being explicitly instantiated somewhere else in the code
extern template void foo(int);
 
// Similarly here
extern template class Foo<int>;

For further reference, see Explicit function template instantiation and Explicit class template instantiation