|
6 | 6 | #ifndef BITCOIN_ARITH_UINT256_H
|
7 | 7 | #define BITCOIN_ARITH_UINT256_H
|
8 | 8 |
|
| 9 | +#include <compare> |
9 | 10 | #include <cstdint>
|
10 | 11 | #include <cstring>
|
11 | 12 | #include <limits>
|
@@ -212,13 +213,8 @@ class base_uint
|
212 | 213 | friend inline base_uint operator<<(const base_uint& a, int shift) { return base_uint(a) <<= shift; }
|
213 | 214 | friend inline base_uint operator*(const base_uint& a, uint32_t b) { return base_uint(a) *= b; }
|
214 | 215 | friend inline bool operator==(const base_uint& a, const base_uint& b) { return memcmp(a.pn, b.pn, sizeof(a.pn)) == 0; }
|
215 |
| - friend inline bool operator!=(const base_uint& a, const base_uint& b) { return memcmp(a.pn, b.pn, sizeof(a.pn)) != 0; } |
216 |
| - friend inline bool operator>(const base_uint& a, const base_uint& b) { return a.CompareTo(b) > 0; } |
217 |
| - friend inline bool operator<(const base_uint& a, const base_uint& b) { return a.CompareTo(b) < 0; } |
218 |
| - friend inline bool operator>=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) >= 0; } |
219 |
| - friend inline bool operator<=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) <= 0; } |
| 216 | + friend inline std::strong_ordering operator<=>(const base_uint& a, const base_uint& b) { return a.CompareTo(b) <=> 0; } |
220 | 217 | friend inline bool operator==(const base_uint& a, uint64_t b) { return a.EqualTo(b); }
|
221 |
| - friend inline bool operator!=(const base_uint& a, uint64_t b) { return !a.EqualTo(b); } |
222 | 218 |
|
223 | 219 | /** Hex encoding of the number (with the most significant digits first). */
|
224 | 220 | std::string GetHex() const;
|
|
0 commit comments