#include <iostream>
using std::cout;
using std::endl;
template <class T>
class CClass {
T n;
public:
CClass(T _n) {
n = _n;
}
};
int main()
{
CClass<int> o1(13), o2(435);
CClass<double> o3(3.14);
cout << typeid(o1).name() << endl;
cout << typeid(o2).name() << endl;
cout << typeid(o3).name() << endl;
if (typeid(o1) == typeid(o2))
cout << "o1 type == o2 type" << endl;
if (typeid(o2) == typeid(o3))
cout << "o2 type == o3 type" << endl;
else
cout << "o2 type != o3 type" << endl;
return 0;
}
/*
run:
class CClass<int>
class CClass<int>
class CClass<double>
o1 type == o2 type
o2 type != o3 type
*/