fixed comparison operators of City

This commit is contained in:
2020-03-29 16:58:35 -06:00
parent 9416bf4dc6
commit 21ca45ead4
10 changed files with 39 additions and 7 deletions

View File

@@ -14,8 +14,14 @@ public:
int GetX(){ return X; }
int GetY(){ return Y; }
int GetName(){ return Name; }
bool operator< (const City &other) const {
return Name < other.Name;
bool operator < (const City &other) const {
return this->Name < other.Name;
}
bool operator > (const City &other) const {
return this->Name > other.Name;
}
bool operator == (const City &other) const{
return this->Name == other.Name;
}
};