讨论C++中模板的一些问题
请高手指教一下template <class T>
T max(T x,T y)
#include <iostream.h>
{
return(x>y)?(x):(y);
}
double max(double ,double);
void main()
{
int x=3,y=4;
long l=5;
double a=1.1,b=3.4;
cout<<max(x,y)<<endl;
cout<<max(a,b)<<endl;
cout<<max(l,a)<<endl;
cout<<max(a,l)<<endl;
cout<<max(x,l)<<endl;
}