diff --git a/src/include/units/quantity_point.h b/src/include/units/quantity_point.h index a881d49e..4397a754 100644 --- a/src/include/units/quantity_point.h +++ b/src/include/units/quantity_point.h @@ -138,66 +138,60 @@ public: // Below friend functions are to be found via argument-dependent lookup only #if __GNUC__ >= 10 - template - [[nodiscard]] friend constexpr auto operator<=>(const quantity_point& lhs, const quantity_point& rhs) - requires requires { lhs.q_ <=> rhs.relative(); } + template + [[nodiscard]] friend constexpr auto operator<=>(const quantity_point& lhs, const QP& rhs) + requires std::three_way_comparable_with { return lhs.q_ <=> rhs.relative(); } - template - [[nodiscard]] friend constexpr auto operator==(const quantity_point& lhs, const quantity_point& rhs) - requires requires { lhs.q_ == rhs.relative(); } + template + [[nodiscard]] friend constexpr auto operator==(const quantity_point& lhs, const QP& rhs) + requires std::equality_comparable_with { return lhs.q_ == rhs.relative(); } #else - template - [[nodiscard]] friend constexpr bool operator==(const quantity_point& lhs, const quantity_point& rhs) - requires equivalent_dim && - std::equality_comparable_with + template + [[nodiscard]] friend constexpr bool operator==(const quantity_point& lhs, const QP& rhs) + requires std::equality_comparable_with { return lhs.q_ == rhs.relative(); } - template - [[nodiscard]] friend constexpr bool operator!=(const quantity_point& lhs, const quantity_point& rhs) - requires equivalent_dim && - std::equality_comparable_with + template + [[nodiscard]] friend constexpr bool operator!=(const quantity_point& lhs, const QP& rhs) + requires std::equality_comparable_with { return !(lhs == rhs); } - template - [[nodiscard]] friend constexpr bool operator<(const quantity_point& lhs, const quantity_point& rhs) - requires equivalent_dim && - std::totally_ordered_with + template + [[nodiscard]] friend constexpr bool operator<(const quantity_point& lhs, const QP& rhs) + requires std::totally_ordered_with { return lhs.q_ < rhs.relative(); } - template - [[nodiscard]] friend constexpr bool operator<=(const quantity_point& lhs, const quantity_point& rhs) - requires equivalent_dim && - std::totally_ordered_with + template + [[nodiscard]] friend constexpr bool operator<=(const quantity_point& lhs, const QP& rhs) + requires std::totally_ordered_with { return !(rhs < lhs); } - template - [[nodiscard]] friend constexpr bool operator>(const quantity_point& lhs, const quantity_point& rhs) - requires equivalent_dim && - std::totally_ordered_with + template + [[nodiscard]] friend constexpr bool operator>(const quantity_point& lhs, const QP& rhs) + requires std::totally_ordered_with { return rhs < lhs; } - template - [[nodiscard]] friend constexpr bool operator>=(const quantity_point& lhs, const quantity_point& rhs) - requires equivalent_dim && - std::totally_ordered_with + template + [[nodiscard]] friend constexpr bool operator>=(const quantity_point& lhs, const QP& rhs) + requires std::totally_ordered_with { return !(lhs < rhs); }