diff options
Diffstat (limited to 'src/common/Cryptography/BigNumber.h')
-rw-r--r-- | src/common/Cryptography/BigNumber.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/common/Cryptography/BigNumber.h b/src/common/Cryptography/BigNumber.h index e61a8073c31..bbe2bebb42d 100644 --- a/src/common/Cryptography/BigNumber.h +++ b/src/common/Cryptography/BigNumber.h @@ -94,12 +94,17 @@ class TC_COMMON_API BigNumber return t <<= n; } - int CompareTo(BigNumber const& bn) const; - bool operator<=(BigNumber const& bn) const { return (CompareTo(bn) <= 0); } + int32 CompareTo(BigNumber const& bn) const; bool operator==(BigNumber const& bn) const { return (CompareTo(bn) == 0); } - bool operator>=(BigNumber const& bn) const { return (CompareTo(bn) >= 0); } - bool operator<(BigNumber const& bn) const { return (CompareTo(bn) < 0); } - bool operator>(BigNumber const& bn) const { return (CompareTo(bn) > 0); } + std::strong_ordering operator<=>(BigNumber const& other) const + { + int32 cmp = CompareTo(other); + if (cmp < 0) + return std::strong_ordering::less; + if (cmp > 0) + return std::strong_ordering::greater; + return std::strong_ordering::equal; + } bool IsZero() const; bool IsNegative() const; |