summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2022-10-18 13:01:36 -0400
committerGravatar Lioncash2022-10-18 16:06:50 -0400
commit9393f90ccfd3131a021a1c5f3e42f20a287a6560 (patch)
treeaee5cd108717245e364e91d988181727ee6fd988
parentfixed_point: Use variable templates and concepts where applicable (diff)
downloadyuzu-9393f90ccfd3131a021a1c5f3e42f20a287a6560.tar.gz
yuzu-9393f90ccfd3131a021a1c5f3e42f20a287a6560.tar.xz
yuzu-9393f90ccfd3131a021a1c5f3e42f20a287a6560.zip
fixed_point: Use defaulted comparisons
Collapses all of the comparison functions down to a single line.
-rw-r--r--src/common/fixed_point.h24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/common/fixed_point.h b/src/common/fixed_point.h
index b2e489841..7f00dd7b5 100644
--- a/src/common/fixed_point.h
+++ b/src/common/fixed_point.h
@@ -301,29 +301,7 @@ public:
301 } 301 }
302 302
303public: // comparison operators 303public: // comparison operators
304 constexpr bool operator==(FixedPoint rhs) const { 304 friend constexpr auto operator<=>(FixedPoint lhs, FixedPoint rhs) = default;
305 return data_ == rhs.data_;
306 }
307
308 constexpr bool operator!=(FixedPoint rhs) const {
309 return data_ != rhs.data_;
310 }
311
312 constexpr bool operator<(FixedPoint rhs) const {
313 return data_ < rhs.data_;
314 }
315
316 constexpr bool operator>(FixedPoint rhs) const {
317 return data_ > rhs.data_;
318 }
319
320 constexpr bool operator<=(FixedPoint rhs) const {
321 return data_ <= rhs.data_;
322 }
323
324 constexpr bool operator>=(FixedPoint rhs) const {
325 return data_ >= rhs.data_;
326 }
327 305
328public: // unary operators 306public: // unary operators
329 constexpr bool operator!() const { 307 constexpr bool operator!() const {