mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-28 01:29:18 +00:00
Spaceship operator didn't work as a I wanted it, so I've gone old school again until I can work out why the "==" operator couldn't be found.
This commit is contained in:
parent
bde2900017
commit
42e72ce077
@ -68,28 +68,15 @@ namespace EightBit {
|
||||
this->word -= rhs.word;
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr auto operator==(const register16_t& rhs) const noexcept { return word == rhs.word; }
|
||||
[[nodiscard]] constexpr auto operator!=(const register16_t& rhs) const noexcept { return word != rhs.word; }
|
||||
[[nodiscard]] constexpr auto operator<(const register16_t& rhs) const noexcept { return word < rhs.word; }
|
||||
[[nodiscard]] constexpr auto operator<=(const register16_t& rhs) const noexcept { return word <= rhs.word; }
|
||||
[[nodiscard]] constexpr auto operator>(const register16_t& rhs) const noexcept { return word > rhs.word; }
|
||||
[[nodiscard]] constexpr auto operator>=(const register16_t& rhs) const noexcept { return word >= rhs.word; }
|
||||
};
|
||||
|
||||
[[nodiscard]] constexpr inline auto operator==(const register16_t lhs, const register16_t rhs) noexcept {
|
||||
return lhs.word == rhs.word;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 202002L
|
||||
[[nodiscard]] constexpr auto operator<=>(const register16_t lhs, const register16_t rhs) noexcept {
|
||||
return lhs.word <=> rhs.word;
|
||||
}
|
||||
#else
|
||||
|
||||
[[nodiscard]] constexpr inline auto operator!=(const register16_t lhs, const register16_t rhs) noexcept {
|
||||
return lhs.word != rhs.word;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr inline auto operator>(const register16_t lhs, const register16_t rhs) noexcept {
|
||||
return lhs.word > rhs.word;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
[[nodiscard]] constexpr inline auto operator+(register16_t lhs, const register16_t rhs) noexcept {
|
||||
lhs += rhs;
|
||||
return lhs;
|
||||
|
Loading…
Reference in New Issue
Block a user