template <typename T> class A{ private: T a; public: A(T x) :a(x){} void display() { cout << a << endl; } }; template<> class A<double> { private: double a; public: A(double x) :a(x){} void display() { cout << a <<"diao"<<endl; } }; int main() { double a = 3.3; A<double> b(a); A<int> c(2); b.display(); c.display(); }