#include
using namespace std;
template class myclass {
T x;
public:
myclass(T a) {
cout << "Inside generic myclass\n";
x = a;
}
T getx() { return x; }
};
template <> class myclass {
int x;
public:
myclass(int a) {
cout << "Inside myclass specialization\n";
x = a * a;
}
int getx() { return x; }
};
int main()
{
myclass d(10.1);
cout << "double: " << d.getx() << "\n\n";
myclass i(5);
cout << "int: " << i.getx() << "\n";
return 0;
}