Re-implement Version comparison operators.

In terms of the less-than operator, for more consistent behaviour.
This commit is contained in:
Oliver Hamlet
2015-07-19 13:08:05 +01:00
parent 83ad38ea5a
commit 80aab0efaf
+6 -6
View File
@@ -138,22 +138,22 @@ namespace loot {
}
bool Version::operator > (const Version& ver) const {
return (*this != ver && !(*this < ver));
return ver < *this;
}
bool Version::operator >= (const Version& ver) const {
return (*this == ver || *this > ver);
return ver < *this || !(*this < ver);
}
bool Version::operator <= (const Version& ver) const {
return (*this == ver || *this < ver);
return *this < ver || !(ver < *this);
}
bool Version::operator == (const Version& ver) const {
return (verString == ver.AsString());
return !(*this < ver) && !(ver < *this);
}
bool Version::operator != (const Version& ver) const {
return !(*this == ver);
}
return *this < ver || ver < *this;
}
}