For each instantiation of the template class the static members are shared only between the objects of that class and are completely independent from static members of other instantiations of the template class. E.g. this program prints "50":
#include
template
class A
{
public:
static int x;
};
template int A::x = 0;
int main()
{
A a;
A b;
a.x = 5;
std::cout << a.x << b.x << std::endl;
return 0;
}