Require explicit inequality as well as equality operators on evalvalues

This commit is contained in:
2019-09-07 13:28:25 +02:00
parent d8c67f2dde
commit fab2c9eabd
9 changed files with 38 additions and 3 deletions

View File

@@ -60,6 +60,10 @@ namespace Porygon::UserData {
return b->GetHashCode() == _hash;
}
bool operator!=(const EvalValue *b) const override {
return !operator==(b);
}
[[nodiscard]] EvalValue* Clone() const final{
return new UserDataCollectionValue(_type, _helper, _hash);
}

View File

@@ -37,6 +37,10 @@ namespace Porygon::UserData {
return _obj == ((UserDataValue *) b)->_obj;
}
bool operator!=(const EvalValue *b) const override {
return !operator==(b);
}
[[nodiscard]]
inline Evaluation::EvalValue* Clone() const final {
auto ud = _userData->Get();
@@ -78,6 +82,7 @@ namespace Porygon::UserData {
EvalValue* Cast(shared_ptr<const ScriptType> castType) const final{
return _userData->Get()->Cast(_obj, castType.get());
}
};
}