此代码运行正确,但在一个不确定的时刻,我在行遇到异常访问冲突
return lhs.getGeneralType()->getID() != rhs.getGeneralType()->getID();
并且错误破坏了我的应用程序...我已经尝试使用/EHa进行编译,但是错误
重复...这行代码多次正确运行,一段时间后出现此错误..
if (lhs.getType() == rhs.getType()) {
try {
if (lhs.getGeneralType() != NULL && lhs.getGeneralType() != NULL)
return lhs.getGeneralType()->getID() != rhs.getGeneralType()->getID();
else if (lhs.getGeneralType() == NULL && lhs.getGeneralType() == NULL)
return false;
else if (lhs.getGeneralType() != NULL && lhs.getGeneralType() == NULL)
return false;
else if (lhs.getGeneralType() == NULL && lhs.getGeneralType() != NULL)
return true;
else
return true;
} catch(char * e) { // tried also exception & , char* e
return true;
}
} else
return true;
getGeneralType() 返回的类型定义如下
class Type
{
private:
int _id;
public:
Type(int id);
operator int() const;
int getID() const;
};