[求助]关于类模板的问题
我的代码:
#include <iostream>
using namespace std;
template <class numtype>
class Compare{
public:
Compare(numtype a, numtype b)
{ x = a; y = b}
numtype max()
{ return (x>y)?x:y }
numtype min()
{ return (x<y)?x:y }
private:
numtype x,y;
};
int main(){
Compare <int> cmp1(19,20);
cout<<"cmp1 max="<<cmp1.max()<<" min="<<cmp1.min()<<endl;
return 0;
}
编译的错误信息:
error C2143: syntax error : missing ';' before '}'
while compiling class-template member function '__thiscall Compare<int>::Compare<int>(int,int)'