diff --git a/src/flatfile.h b/src/flatfile.h index 3edb0b85da4..94ee9062d87 100644 --- a/src/flatfile.h +++ b/src/flatfile.h @@ -29,10 +29,6 @@ struct FlatFilePos return (a.nFile == b.nFile && a.nPos == b.nPos); } - friend bool operator!=(const FlatFilePos &a, const FlatFilePos &b) { - return !(a == b); - } - bool IsNull() const { return (nFile == -1); } std::string ToString() const; diff --git a/src/netaddress.h b/src/netaddress.h index 48dbf03a023..c65568098e6 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -210,7 +210,6 @@ public: bool GetIn6Addr(struct in6_addr* pipv6Addr) const; friend bool operator==(const CNetAddr& a, const CNetAddr& b); - friend bool operator!=(const CNetAddr& a, const CNetAddr& b) { return !(a == b); } friend bool operator<(const CNetAddr& a, const CNetAddr& b); /** @@ -523,7 +522,6 @@ public: bool IsValid() const; friend bool operator==(const CSubNet& a, const CSubNet& b); - friend bool operator!=(const CSubNet& a, const CSubNet& b) { return !(a == b); } friend bool operator<(const CSubNet& a, const CSubNet& b); }; @@ -554,7 +552,6 @@ public: */ [[nodiscard]] sa_family_t GetSAFamily() const; friend bool operator==(const CService& a, const CService& b); - friend bool operator!=(const CService& a, const CService& b) { return !(a == b); } friend bool operator<(const CService& a, const CService& b); std::vector GetKey() const; std::string ToStringAddrPort() const; diff --git a/src/prevector.h b/src/prevector.h index fb7d52f418d..2c794d71041 100644 --- a/src/prevector.h +++ b/src/prevector.h @@ -72,7 +72,6 @@ public: iterator operator-(size_type n) const { return iterator(ptr - n); } iterator& operator-=(size_type n) { ptr -= n; return *this; } bool operator==(iterator x) const { return ptr == x.ptr; } - bool operator!=(iterator x) const { return ptr != x.ptr; } bool operator>=(iterator x) const { return ptr >= x.ptr; } bool operator<=(iterator x) const { return ptr <= x.ptr; } bool operator>(iterator x) const { return ptr > x.ptr; } @@ -104,7 +103,6 @@ public: const_iterator operator-(size_type n) const { return const_iterator(ptr - n); } const_iterator& operator-=(size_type n) { ptr -= n; return *this; } bool operator==(const_iterator x) const { return ptr == x.ptr; } - bool operator!=(const_iterator x) const { return ptr != x.ptr; } bool operator>=(const_iterator x) const { return ptr >= x.ptr; } bool operator<=(const_iterator x) const { return ptr <= x.ptr; } bool operator>(const_iterator x) const { return ptr > x.ptr; } @@ -451,10 +449,6 @@ public: return true; } - bool operator!=(const prevector& other) const { - return !(*this == other); - } - bool operator<(const prevector& other) const { if (size() < other.size()) { return true; diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 295bce61b93..da3db602306 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -51,11 +51,6 @@ public: return (a.hash == b.hash && a.n == b.n); } - friend bool operator!=(const COutPoint& a, const COutPoint& b) - { - return !(a == b); - } - std::string ToString() const; }; @@ -135,11 +130,6 @@ public: a.nSequence == b.nSequence); } - friend bool operator!=(const CTxIn& a, const CTxIn& b) - { - return !(a == b); - } - std::string ToString() const; }; @@ -178,11 +168,6 @@ public: a.scriptPubKey == b.scriptPubKey); } - friend bool operator!=(const CTxOut& a, const CTxOut& b) - { - return !(a == b); - } - std::string ToString() const; }; @@ -363,11 +348,6 @@ public: return a.GetWitnessHash() == b.GetWitnessHash(); } - friend bool operator!=(const CTransaction& a, const CTransaction& b) - { - return !operator==(a, b); - } - std::string ToString() const; bool HasWitness() const { return m_has_witness; } diff --git a/src/primitives/transaction_identifier.h b/src/primitives/transaction_identifier.h index b753c1df39e..79af2ddeb63 100644 --- a/src/primitives/transaction_identifier.h +++ b/src/primitives/transaction_identifier.h @@ -38,8 +38,6 @@ public: template bool operator==(const Other& other) const { return Compare(other) == 0; } template - bool operator!=(const Other& other) const { return Compare(other) != 0; } - template bool operator<(const Other& other) const { return Compare(other) < 0; } const uint256& ToUint256() const LIFETIMEBOUND { return m_wrapped; } diff --git a/src/pubkey.h b/src/pubkey.h index 5ae7f75dde9..02ad7371a79 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -121,10 +121,6 @@ public: return a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) == 0; } - friend bool operator!=(const CPubKey& a, const CPubKey& b) - { - return !(a == b); - } friend bool operator<(const CPubKey& a, const CPubKey& b) { return a.vch[0] < b.vch[0] || @@ -302,7 +298,6 @@ public: unsigned char* begin() { return m_keydata.begin(); } unsigned char* end() { return m_keydata.end(); } bool operator==(const XOnlyPubKey& other) const { return m_keydata == other.m_keydata; } - bool operator!=(const XOnlyPubKey& other) const { return m_keydata != other.m_keydata; } bool operator<(const XOnlyPubKey& other) const { return m_keydata < other.m_keydata; } //! Implement serialization without length prefixes since it is a fixed length @@ -336,11 +331,6 @@ public: { return a.m_pubkey == b.m_pubkey; } - - bool friend operator!=(const EllSwiftPubKey& a, const EllSwiftPubKey& b) - { - return a.m_pubkey != b.m_pubkey; - } }; struct CExtPubKey { @@ -360,11 +350,6 @@ struct CExtPubKey { a.pubkey == b.pubkey; } - friend bool operator!=(const CExtPubKey &a, const CExtPubKey &b) - { - return !(a == b); - } - friend bool operator<(const CExtPubKey &a, const CExtPubKey &b) { if (a.pubkey < b.pubkey) { diff --git a/src/script/script.h b/src/script/script.h index b556aae6060..633b5609c05 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -270,14 +270,12 @@ public: } inline bool operator==(const int64_t& rhs) const { return m_value == rhs; } - inline bool operator!=(const int64_t& rhs) const { return m_value != rhs; } inline bool operator<=(const int64_t& rhs) const { return m_value <= rhs; } inline bool operator< (const int64_t& rhs) const { return m_value < rhs; } inline bool operator>=(const int64_t& rhs) const { return m_value >= rhs; } inline bool operator> (const int64_t& rhs) const { return m_value > rhs; } inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); } - inline bool operator!=(const CScriptNum& rhs) const { return operator!=(rhs.m_value); } inline bool operator<=(const CScriptNum& rhs) const { return operator<=(rhs.m_value); } inline bool operator< (const CScriptNum& rhs) const { return operator< (rhs.m_value); } inline bool operator>=(const CScriptNum& rhs) const { return operator>=(rhs.m_value); } diff --git a/src/support/allocators/pool.h b/src/support/allocators/pool.h index 86b5da5a8a8..108f09385c1 100644 --- a/src/support/allocators/pool.h +++ b/src/support/allocators/pool.h @@ -352,11 +352,4 @@ bool operator==(const PoolAllocator& a, return a.resource() == b.resource(); } -template -bool operator!=(const PoolAllocator& a, - const PoolAllocator& b) noexcept -{ - return !(a == b); -} - #endif // BITCOIN_SUPPORT_ALLOCATORS_POOL_H diff --git a/src/support/allocators/secure.h b/src/support/allocators/secure.h index e7ffc9e201c..8285b306f43 100644 --- a/src/support/allocators/secure.h +++ b/src/support/allocators/secure.h @@ -46,11 +46,6 @@ struct secure_allocator { { return true; } - template - friend bool operator!=(const secure_allocator&, const secure_allocator&) noexcept - { - return false; - } }; // This is exactly like std::string, but with a custom allocator. diff --git a/src/support/allocators/zeroafterfree.h b/src/support/allocators/zeroafterfree.h index 6d50eb70a6f..9a942a4157e 100644 --- a/src/support/allocators/zeroafterfree.h +++ b/src/support/allocators/zeroafterfree.h @@ -38,11 +38,6 @@ struct zero_after_free_allocator { { return true; } - template - friend bool operator!=(const zero_after_free_allocator&, const zero_after_free_allocator&) noexcept - { - return false; - } }; /** Byte-vector that clears its contents before deletion. */ diff --git a/src/test/scriptnum10.h b/src/test/scriptnum10.h index db66f3a14c9..bf708aacd6e 100644 --- a/src/test/scriptnum10.h +++ b/src/test/scriptnum10.h @@ -61,14 +61,12 @@ public: } inline bool operator==(const int64_t& rhs) const { return m_value == rhs; } - inline bool operator!=(const int64_t& rhs) const { return m_value != rhs; } inline bool operator<=(const int64_t& rhs) const { return m_value <= rhs; } inline bool operator< (const int64_t& rhs) const { return m_value < rhs; } inline bool operator>=(const int64_t& rhs) const { return m_value >= rhs; } inline bool operator> (const int64_t& rhs) const { return m_value > rhs; } inline bool operator==(const CScriptNum10& rhs) const { return operator==(rhs.m_value); } - inline bool operator!=(const CScriptNum10& rhs) const { return operator!=(rhs.m_value); } inline bool operator<=(const CScriptNum10& rhs) const { return operator<=(rhs.m_value); } inline bool operator< (const CScriptNum10& rhs) const { return operator< (rhs.m_value); } inline bool operator>=(const CScriptNum10& rhs) const { return operator>=(rhs.m_value); } diff --git a/src/uint256.h b/src/uint256.h index 85c030dc1f7..d42042750fa 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -64,7 +64,6 @@ public: constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); } friend constexpr bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; } - friend constexpr bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; } friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; } /** @name Hex representation diff --git a/src/util/bitdeque.h b/src/util/bitdeque.h index ac9d3024204..2d21c8b3b39 100644 --- a/src/util/bitdeque.h +++ b/src/util/bitdeque.h @@ -104,7 +104,6 @@ class bitdeque friend bool operator<=(const Iterator& x, const Iterator& y) { return std::tie(x.m_it, x.m_bitpos) <= std::tie(y.m_it, y.m_bitpos); } friend bool operator>=(const Iterator& x, const Iterator& y) { return std::tie(x.m_it, x.m_bitpos) >= std::tie(y.m_it, y.m_bitpos); } friend bool operator==(const Iterator& x, const Iterator& y) { return x.m_it == y.m_it && x.m_bitpos == y.m_bitpos; } - friend bool operator!=(const Iterator& x, const Iterator& y) { return x.m_it != y.m_it || x.m_bitpos != y.m_bitpos; } reference operator*() const { return (*m_it)[m_bitpos]; } reference operator[](difference_type pos) const { return *(*this + pos); } }; diff --git a/src/util/hash_type.h b/src/util/hash_type.h index 13b831cf19d..5b4f93b89f1 100644 --- a/src/util/hash_type.h +++ b/src/util/hash_type.h @@ -50,11 +50,6 @@ public: return m_hash == other.m_hash; } - bool operator!=(const BaseHash& other) const noexcept - { - return !(m_hash == other.m_hash); - } - bool operator<(const BaseHash& other) const noexcept { return m_hash < other.m_hash;