diff options
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"); |
