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.
1From 679e8bda1eb0cc98acb981e9a10204bed1c179f2 Mon Sep 17 00:00:00 20012From: Giuseppe D'Angelo <[email protected]>3Date: Tue, 20 Jan 2026 15:23:31 +01004Subject: [PATCH] qhashfunctions.h: include QBitArray6In qhashfunctions.h we're declaring a std::hash specialization for7QBitArray. That specialization instantiates8QNothrowHashable_v<QBitArray>, which checks if qHash(QBitArray) is9noexcept.11The problem is that there are already qHash(QByteArrayView) and12qHash(QStringView) around, which will be picked up by overload13resolution. That, in turn, will try to instantiate the QBAV/QSV14constructors from a generic container. That instantiation will fail15because QBitArray is not complete yet.17When we later complete QBitArray, GCC is going to complain.19Therefore, complete QBitArray before attempting SFINAE tricks on it.21As an alternative, I could've moved the std::hash specialization22to qbitarray.h. However I noticed that qHash(QBitArray) is still23declared into qhashfunctions.h, i.e. hashing QBitArrays didn't24require the full type, and therefore moving std::hash would've been25a potential SIC?27Task-number: QTBUG-14347028Change-Id: Ie79d15e77d1fb3c86de6d7480a66bddc39f1766629Reviewed-by: Thiago Macieira <[email protected]>30---31src/corelib/tools/qhashfunctions.h | 5 +++--321 file changed, 3 insertions(+), 2 deletions(-)34diff --git a/qtbase/src/corelib/tools/qhashfunctions.h b/qtbase/src/corelib/tools/qhashfunctions.h35index 8f1394c8ad35..beef80557865 10064436--- a/qtbase/src/corelib/tools/qhashfunctions.h37+++ b/qtbase/src/corelib/tools/qhashfunctions.h38@@ -8,6 +8,9 @@40#include <QtCore/qstring.h>41#include <QtCore/qstringfwd.h>42+#ifndef QT_BOOTSTRAPPED43+#include <QtCore/qbitarray.h>44+#endif46#include <numeric> // for std::accumulate47#include <functional> // for std::hash48@@ -25,8 +28,6 @@50QT_BEGIN_NAMESPACE52-class QBitArray;53-54#if QT_DEPRECATED_SINCE(6,6)55QT_DEPRECATED_VERSION_X_6_6("Use QHashSeed instead")56Q_CORE_EXPORT int qGlobalQHashSeed();
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.