Code://MyTemplate template<class T> class MyTemplate { public: static int counter; };It seems obvious that there are TWO static counter's here, MyTemplate<int>::counter and MyTemplate<float>::counterCode://main int main(void) { MyTemplate<int> i; MyTemplate<float> f; return 1; }
With that in mind, I have two questions
1. is it possible to create a static across ALL MyTemplate's?
2. Where would the following line go? and would there be any problems with putting it there that you can see?
int MyTemplate<T>::counter = 0;