软件VC6语言C++在练习类模块出现fatal error C1001: INTERNAL COMPILER ERROR

具体代码
// class templates
#include<iostream>
using namespace std;
template <class T>
class pair {
T value1;T value2;
public:
pair (T first, T second) {
value1=first;
value2=second;
}
T getmax ();
};

/*template <class T>
T pair::getmax (){
T retval;
retval = value1>value2? value1 : value2;
return retval;
}

int main () {
pair myobject (100, 75);
cout << myobject.getmax();
return 0;
}*/
编译错误:
C:\Users\hyf\Desktop\VC++program\Cpp1.cpp(13) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.

Cpp1.exe - 1 error(s), 0 warning(s)

pair myobject (100, 75);这里出错 没有明确的指出T的类型,好像是pair<int> myobject (100, 75); 有可能不是这样写的,可以自己去查查追问

下面代码没用,只运行了类模块说明,定义

温馨提示:答案为网友推荐,仅供参考
相似回答