So I have this file
template <typename T>
class TestStatic {
public:
static int staticVal;
};
//static member initialization
template<typename T> int TestStatic<T>::staticVal;
I don’t understand why I have to instantiate the Staticval isn’t it already instantiated in the class definition? Also does it generate a static variable for each template parameter types?
Thanks in advance.