nit (here and for all other new operator<=>): perhaps better to be explicit about the std::strong_ordering return type? And perhaps making it constexpr while touching?
0diff --git a/src/prevector.h b/src/prevector.h
1index d4d90c7350..595be4a603 100644
2--- a/src/prevector.h
3+++ b/src/prevector.h
4@@ -7,6 +7,7 @@
5
6 #include <algorithm>
7 #include <cassert>
8+#include <compare>
9 #include <cstddef>
10 #include <cstdint>
11 #include <cstdlib>
12@@ -71,8 +72,8 @@ public:
13 iterator& operator+=(size_type n) { ptr += n; return *this; }
14 iterator operator-(size_type n) const { return iterator(ptr - n); }
15 iterator& operator-=(size_type n) { ptr -= n; return *this; }
16- bool operator==(iterator x) const { return ptr == x.ptr; }
17- auto operator<=>(iterator x) const { return ptr <=> x.ptr; }
18+ constexpr bool operator==(iterator x) const { return ptr == x.ptr; }
19+ constexpr std::strong_ordering operator<=>(iterator x) const { return ptr <=> x.ptr; }
20 };
21
22 class const_iterator {
23@@ -99,8 +100,8 @@ public:
24 const_iterator& operator+=(size_type n) { ptr += n; return *this; }
25 const_iterator operator-(size_type n) const { return const_iterator(ptr - n); }
26 const_iterator& operator-=(size_type n) { ptr -= n; return *this; }
27- bool operator==(const_iterator x) const { return ptr == x.ptr; }
28- auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; }
29+ constexpr bool operator==(const_iterator x) const { return ptr == x.ptr; }
30+ constexpr std::strong_ordering operator<=>(const_iterator x) const { return ptr <=> x.ptr; }
31 };
32
33 private:
34diff --git a/src/script/script.h b/src/script/script.h
35index b06be9c975..f1472a7dd3 100644
36--- a/src/script/script.h
37+++ b/src/script/script.h
38@@ -14,6 +14,7 @@
39 #include <util/hash_type.h>
40
41 #include <cassert>
42+#include <compare>
43 #include <cstdint>
44 #include <cstring>
45 #include <limits>
46@@ -269,11 +270,11 @@ public:
47 m_value = set_vch(vch);
48 }
49
50- inline bool operator==(const int64_t& rhs) const { return m_value == rhs; }
51- inline auto operator<=>(const int64_t& rhs) const { return m_value <=> rhs; }
52+ inline constexpr bool operator==(const int64_t& rhs) const { return m_value == rhs; }
53+ inline constexpr std::strong_ordering operator<=>(const int64_t& rhs) const { return m_value <=> rhs; }
54
55- inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); }
56- inline auto operator<=>(const CScriptNum& rhs) const { return operator<=>(rhs.m_value); }
57+ inline constexpr bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); }
58+ inline constexpr std::strong_ordering operator<=>(const CScriptNum& rhs) const { return operator<=>(rhs.m_value); }
59
60 inline CScriptNum operator+( const int64_t& rhs) const { return CScriptNum(m_value + rhs);}
61 inline CScriptNum operator-( const int64_t& rhs) const { return CScriptNum(m_value - rhs);}
62diff --git a/src/test/scriptnum10.h b/src/test/scriptnum10.h
63index 402606714d..fd112d6ff7 100644
64--- a/src/test/scriptnum10.h
65+++ b/src/test/scriptnum10.h
66@@ -7,6 +7,7 @@
67 #define BITCOIN_TEST_SCRIPTNUM10_H
68
69 #include <cassert>
70+#include <compare>
71 #include <cstdint>
72 #include <limits>
73 #include <stdexcept>
74@@ -60,11 +61,11 @@ public:
75 m_value = set_vch(vch);
76 }
77
78- inline bool operator==(const int64_t& rhs) const { return m_value == rhs; }
79- inline auto operator<=>(const int64_t& rhs) const { return m_value <=> rhs; }
80+ inline constexpr bool operator==(const int64_t& rhs) const { return m_value == rhs; }
81+ inline constexpr std::strong_ordering operator<=>(const int64_t& rhs) const { return m_value <=> rhs; }
82
83- inline bool operator==(const CScriptNum10& rhs) const { return operator==(rhs.m_value); }
84- inline auto operator<=>(const CScriptNum10& rhs) const { return operator<=>(rhs.m_value); }
85+ inline constexpr bool operator==(const CScriptNum10& rhs) const { return operator==(rhs.m_value); }
86+ inline constexpr std::strong_ordering operator<=>(const CScriptNum10& rhs) const { return operator<=>(rhs.m_value); }
87
88 inline CScriptNum10 operator+( const int64_t& rhs) const { return CScriptNum10(m_value + rhs);}
89 inline CScriptNum10 operator-( const int64_t& rhs) const { return CScriptNum10(m_value - rhs);}
90diff --git a/src/util/bitdeque.h b/src/util/bitdeque.h
91index 21934e02da..be3e0fd859 100644
92--- a/src/util/bitdeque.h
93+++ b/src/util/bitdeque.h
94@@ -6,6 +6,7 @@
95 #define BITCOIN_UTIL_BITDEQUE_H
96
97 #include <bitset>
98+#include <compare>
99 #include <cstddef>
100 #include <deque>
101 #include <limits>
102@@ -99,8 +100,8 @@ class bitdeque
103 friend Iterator operator+(Iterator x, difference_type dist) { x += dist; return x; }
104 friend Iterator operator+(difference_type dist, Iterator x) { x += dist; return x; }
105 friend Iterator operator-(Iterator x, difference_type dist) { x -= dist; return x; }
106- friend auto operator<=>(const Iterator& x, const Iterator& y) { return std::tie(x.m_it, x.m_bitpos) <=> std::tie(y.m_it, y.m_bitpos); }
107- friend bool operator==(const Iterator& x, const Iterator& y) { return x.m_it == y.m_it && x.m_bitpos == y.m_bitpos; }
108+ friend constexpr std::strong_ordering operator<=>(const Iterator& x, const Iterator& y) { return std::tie(x.m_it, x.m_bitpos) <=> std::tie(y.m_it, y.m_bitpos); }
109+ friend constexpr bool operator==(const Iterator& x, const Iterator& y) { return x.m_it == y.m_it && x.m_bitpos == y.m_bitpos; }
110 reference operator*() const { return (*m_it)[m_bitpos]; }
111 reference operator[](difference_type pos) const { return *(*this + pos); }
112 };