我想模板里头嵌套模板,要怎么写呢?
#include
template
Typemax(Typex,Typey)
{
return(x>y)?x:y;
}
template
Typemax(Typex,Typey,Typez)
{
Typet;
t=max(Typex,Typey);
return(t>z)?t:z;
}
main()
{
intm=10,n=20,max2;
floata=10.1f,b=20.2f,c=30.3f,max3;
max2=max(m,n);max3=max(a,b,c);
cout
|