diff options
| author | batsumaru <> | 2026-08-19 20:38:28 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-08-19 20:38:28 +0900 |
| commit | 45bec8812c9d5aa1065cf36a8ca878fda5a6b325 (patch) | |
| tree | 2a24923cc49ed640fce129a291beed038cd47786 /include/fixed_point.h | |
| parent | 8918325808f9e474c473f4e1c1b4e4e73b8187cf (diff) | |
Diffstat (limited to 'include/fixed_point.h')
| -rw-r--r-- | include/fixed_point.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/fixed_point.h b/include/fixed_point.h index 385ccc2..2a9ec8d 100644 --- a/include/fixed_point.h +++ b/include/fixed_point.h @@ -3,6 +3,7 @@ #include <cstdint> #include <type_traits> +#include <compare> struct fp_t { static constexpr std::int32_t Q = 16; @@ -16,7 +17,7 @@ struct fp_t { fp_t operator-(const fp_t& other) const; fp_t operator*(const fp_t& other) const; fp_t operator/(const fp_t& other) const; - bool operator==(const fp_t& other) const; + auto operator<=>(const fp_t&) const = default; }; static_assert(std::is_trivially_copyable_v<fp_t>, "fp_t must remain trivially copyable for rollback determinism"); |
