Suppose I\'ve declared:
template void foo(T& t);
Now, what is the difference between
template <&
template <> void foo<int>(int& t);
declares a specialization of the template, with potentially different body.
template void foo<int>(int& t);
causes an explicit instantiation of the template, but doesn't introduce a specialization. It just forces the instantiation of the template for a specific type.
With class/struct,
template <typename T> struct foo {};
Following is a specialization:
template <> struct foo<int>{};
Following is an explicit instantiation:
template struct foo<int>;