Merge pull request #13518 from tygyh/Fix-Partition-struct-comparison-operators

DiscIO/Volume: Fix Partition struct comparison operators
This commit is contained in:
Jordan Woyak 2025-04-16 00:20:28 -05:00 committed by GitHub
commit f8bf35e6f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,10 +32,7 @@ struct Partition final
constexpr Partition() = default; constexpr Partition() = default;
constexpr explicit Partition(u64 offset_) : offset(offset_) {} constexpr explicit Partition(u64 offset_) : offset(offset_) {}
constexpr bool operator==(const Partition& other) const { return offset == other.offset; } constexpr bool operator==(const Partition& other) const { return offset == other.offset; }
constexpr bool operator<(const Partition& other) const { return offset < other.offset; } constexpr auto operator<=>(const Partition other) const { return offset <=> other.offset; }
constexpr bool operator>(const Partition& other) const { return other < *this; }
constexpr bool operator<=(const Partition& other) const { return !(*this < other); }
constexpr bool operator>=(const Partition& other) const { return !(*this > other); }
u64 offset{std::numeric_limits<u64>::max()}; u64 offset{std::numeric_limits<u64>::max()};
}; };