I cannot run a static member inside a fully specialized class template!
I am trying to do the following:
template<typename Type> class X { }; template<> class X<int> { public: static int Value; }
But I can not imagine a static member, I tried everything like:
template<> int X<int>::Value = 0;
It does not compile, so any pointers on how to actually do this will be nice;)
Edit: the answer below is correct, but you also need to put init in the .cpp file and not in the header file.
Thanks for your time, Richard.
c ++ templates
Richard
source share