add extra symbol comparison methods

This commit is contained in:
Dr-Carlos 2022-12-23 09:51:00 +11:00
parent b494a30404
commit efaad5b980
1 changed files with 30 additions and 1 deletions

View File

@ -37,7 +37,36 @@ struct Symbol
bool operator<(const FxOS::Symbol &right) const
{
return (type < right.type) || (value < right.value);
return (type < right.type)
|| (value < right.value && type == right.type);
}
bool operator>(const FxOS::Symbol &right) const
{
return (type > right.type)
|| (value > right.value && type == right.type);
}
bool operator==(const FxOS::Symbol &right) const
{
return value == right.value && type == right.type;
}
bool operator!=(const FxOS::Symbol &right) const
{
return value != right.value || type != right.type;
}
bool operator>=(const FxOS::Symbol &right) const
{
return (type > right.type)
|| (value >= right.value && type == right.type);
}
bool operator<=(const FxOS::Symbol &right) const
{
return (type < right.type)
|| (value <= right.value && type == right.type);
}
};