Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1commit e3da7da967b94f373c29a198ce45f30fb9f0e5172Author: Ed Catmur <[email protected]>3Date: Tue Jan 31 16:27:04 2023 +00005Remove operator!= synthesized by spaceship7An operator!= suppresses the reversed equality comparison candidate generation.9This is visible in clang 16 (rc0 just released) and in gcc trunk (so probably gcc 13).11diff --git a/c++/src/kj/string.h b/c++/src/kj/string.h12index 193442aa..17835892 10064413--- a/c++/src/kj/string.h14+++ b/c++/src/kj/string.h15@@ -122,10 +122,14 @@ public:16inline constexpr const char* end() const { return content.end() - 1; }18inline constexpr bool operator==(decltype(nullptr)) const { return content.size() <= 1; }19+#if !__cpp_impl_three_way_comparison20inline constexpr bool operator!=(decltype(nullptr)) const { return content.size() > 1; }21+#endif23inline bool operator==(const StringPtr& other) const;24+#if !__cpp_impl_three_way_comparison25inline bool operator!=(const StringPtr& other) const { return !(*this == other); }26+#endif27inline bool operator< (const StringPtr& other) const;28inline bool operator> (const StringPtr& other) const { return other < *this; }29inline bool operator<=(const StringPtr& other) const { return !(other < *this); }
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.