Just a quick and simple question, but couldn’t find it in any documentation.
template <class T> T* Some_Class<T>::Some_Static_Variable = NULL;
It compiles with g++, but I am not sure if this is valid usage. Is it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes this code is correct. See this C++ Templates tutorial for more information
http://www.is.pku.edu.cn/~qzy/cpp/vc-stl/templates.htm#T14