this code runs correctly but at a unspecific moment im getting an exception access violation at line
return lhs.getGeneralType()->getID() != rhs.getGeneralType()->getID();
and the error breaks my application… ive already tried to compile with /EHa but the error
repeating… this line of code runs correctly many times and after some time this error occurs..
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;
the definition of Type which getGeneralType() returns is that below
class Type
{
private:
int _id;
public:
Type(int id);
operator int() const;
int getID() const;
};
It looks like a spelling mistake in the if-statements
One of the
lhs‘s should probably berhs.