The extern
is superfluous here. It means that functions instantiated from this template have external linkage. It's the normal extern
you'd apply to an ordinary function definition to indicate it has external linkage. Which is also superfluous, since functions have external linkage by default. So it's the same as
template <class T> void f(T a);
You've mentioned that several explicit instantiations (or maybe specialisations, your question's not clear on this) are defined in the .cpp
file. This still has nothing to do with the extern
keyword being used, and could be done without it as well.