diff --git a/src/cargotype.h b/src/cargotype.h index b2b6f70190..c36aa3afcb 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -168,7 +168,6 @@ struct CargoSpec { }; bool operator==(const Iterator &other) const { return this->index == other.index; } - bool operator!=(const Iterator &other) const { return !(*this == other); } CargoSpec * operator*() const { return CargoSpec::Get(this->index); } Iterator & operator++() { this->index++; this->ValidateIndex(); return *this; } diff --git a/src/core/bitmath_func.hpp b/src/core/bitmath_func.hpp index befcb1d45c..ed4461e2c1 100644 --- a/src/core/bitmath_func.hpp +++ b/src/core/bitmath_func.hpp @@ -315,7 +315,6 @@ struct SetBitIterator { { return this->bitset == other.bitset; } - bool operator!=(const Iterator &other) const { return !(*this == other); } Tbitpos operator*() const { return this->bitpos; } Iterator & operator++() { this->Next(); this->Validate(); return *this; } diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index b4c7cdb794..5cb69fa3c4 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -162,7 +162,6 @@ public: }; bool operator==(const PoolIterator &other) const { return this->index == other.index; } - bool operator!=(const PoolIterator &other) const { return !(*this == other); } T * operator*() const { return T::Get(this->index); } PoolIterator & operator++() { this->index++; this->ValidateIndex(); return *this; } @@ -206,7 +205,6 @@ public: }; bool operator==(const PoolIteratorFiltered &other) const { return this->index == other.index; } - bool operator!=(const PoolIteratorFiltered &other) const { return !(*this == other); } T * operator*() const { return T::Get(this->index); } PoolIteratorFiltered & operator++() { this->index++; this->ValidateIndex(); return *this; } diff --git a/src/fios.cpp b/src/fios.cpp index 0cdae26f71..cdb653a338 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -618,11 +618,6 @@ struct ScenarioIdentifier { { return this->scenid == other.scenid && this->md5sum == other.md5sum; } - - bool operator != (const ScenarioIdentifier &other) const - { - return !(*this == other); - } }; /** diff --git a/src/map_func.h b/src/map_func.h index 45a5a3ee98..9f34cb835b 100644 --- a/src/map_func.h +++ b/src/map_func.h @@ -217,7 +217,6 @@ private: explicit Iterator(TileIndex index) : index(index) {} bool operator==(const Iterator &other) const { return this->index == other.index; } - bool operator!=(const Iterator &other) const { return !(*this == other); } Tile operator*() const { return this->index; } Iterator & operator++() { this->index++; return *this; } private: diff --git a/src/order_type.h b/src/order_type.h index 2701b029fe..8df0889af0 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -30,14 +30,9 @@ struct DestinationID { constexpr BaseType base() const noexcept { return this->value; } constexpr bool operator ==(const DestinationID &destination) const { return this->value == destination.value; } - constexpr bool operator !=(const DestinationID &destination) const { return this->value != destination.value; } constexpr bool operator ==(const StationID &station) const { return this->value == station; } - constexpr bool operator !=(const StationID &station) const { return this->value != station; } }; -constexpr bool operator ==(const StationID &station, const DestinationID &destination) { return destination == station; } -constexpr bool operator !=(const StationID &station, const DestinationID &destination) { return destination != station; } - /** Invalid vehicle order index (sentinel) */ static const VehicleOrderID INVALID_VEH_ORDER_ID = 0xFF; /** Last valid VehicleOrderID. */ diff --git a/src/pathfinder/water_regions.h b/src/pathfinder/water_regions.h index bc278dd2aa..9364b2e1eb 100644 --- a/src/pathfinder/water_regions.h +++ b/src/pathfinder/water_regions.h @@ -30,7 +30,6 @@ struct WaterRegionPatchDesc TWaterRegionPatchLabel label; ///< Unique label identifying the patch within the region bool operator==(const WaterRegionPatchDesc &other) const { return x == other.x && y == other.y && label == other.label; } - bool operator!=(const WaterRegionPatchDesc &other) const { return !(*this == other); } }; @@ -46,7 +45,6 @@ struct WaterRegionDesc WaterRegionDesc(const WaterRegionPatchDesc &water_region_patch) : x(water_region_patch.x), y(water_region_patch.y) {} bool operator==(const WaterRegionDesc &other) const { return x == other.x && y == other.y; } - bool operator!=(const WaterRegionDesc &other) const { return !(*this == other); } }; int CalculateWaterRegionPatchHash(const WaterRegionPatchDesc &water_region_patch); diff --git a/src/tilearea_type.h b/src/tilearea_type.h index 2f7f4e0f20..9add7cfe8b 100644 --- a/src/tilearea_type.h +++ b/src/tilearea_type.h @@ -152,13 +152,6 @@ public: { return this->tile == rhs.tile; } - /** - * Inequality comparison. - */ - bool operator !=(const TileIterator &rhs) const - { - return this->tile != rhs.tile; - } /** * Equality comparison. @@ -167,13 +160,6 @@ public: { return this->tile == rhs; } - /** - * Inequality comparison. - */ - bool operator !=(const TileIndex &rhs) const - { - return this->tile != rhs; - } static std::unique_ptr Create(TileIndex corner1, TileIndex corner2, bool diagonal); }; diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 3c8734f131..8ed12f9c22 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -179,12 +179,6 @@ struct CargoSummaryItem { uint amount; ///< Amount that is carried StationID source; ///< One of the source stations - /** Used by CargoSummary::Find() and similar functions */ - inline bool operator != (const CargoSummaryItem &other) const - { - return this->cargo != other.cargo || this->subtype != other.subtype; - } - /** Used by std::find() and similar functions */ inline bool operator == (const CargoSummaryItem &other) const { diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 1aa29bbd2b..52a82cb594 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -141,11 +141,6 @@ struct VehicleSpriteSeq { return this->count == other.count && MemCmpT(this->seq, other.seq, this->count) == 0; } - bool operator!=(const VehicleSpriteSeq &other) const - { - return !this->operator==(other); - } - /** * Check whether the sequence contains any sprites. */ @@ -1050,7 +1045,6 @@ public: } bool operator==(const OrderIterator &other) const { return this->order == other.order; } - bool operator!=(const OrderIterator &other) const { return !(*this == other); } Order * operator*() const { return this->order; } OrderIterator & operator++() { diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index d68f422971..b9509eb170 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -665,16 +665,6 @@ struct RefitOption { uint8_t subtype; ///< Subcargo to use StringID string; ///< GRF-local String to display for the cargo - /** - * Inequality operator for #RefitOption. - * @param other Compare to this #RefitOption. - * @return True if both #RefitOption are different. - */ - inline bool operator != (const RefitOption &other) const - { - return other.cargo != this->cargo || other.string != this->string; - } - /** * Equality operator for #RefitOption. * @param other Compare to this #RefitOption. diff --git a/src/window_gui.h b/src/window_gui.h index a024a09029..0d2810a53e 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -872,7 +872,6 @@ public: explicit WindowIterator(const Window *w) : it(w->z_position) {} bool operator==(const WindowIterator &other) const { return this->it == other.it; } - bool operator!=(const WindowIterator &other) const { return !(*this == other); } Window * operator*() const { return *this->it; } WindowIterator & operator++() { this->Next(); this->Validate(); return *this; }