#include<iostream>
using namespace std;
template<class T>
class Hello{
public:
static T mNum;
};
template<class T>
T Hello<T>::mNum = 0;
int main(){
Hello<int> h1,h2;
Hello<double> e1,e2;
h1.mNum=100;
e1.mNum=100.11;
//int类型的模板函数中的所有对象共享static的int值
cout<<"h1.mNum = "<<h1.mNum<<" "<<"h2.mNum = "<<h2.mNum<<endl;
//double类型的模板函数中的所有对象共享static的double值
cout<<"e1.mNum = "<<e1.mNum<<" "<<"e2.mNum = "<<e2.mNum<<endl;
return 0;
}