Inside Bitcoin
Opening the selected file…
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.
1# Copyright (c) 2026-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5include_guard(GLOBAL)7# Checks for C++ features required to compile Bitcoin Core.9include(CheckCXXSourceCompiles)11function(check_cxx_features)12set(CMAKE_REQUIRED_QUIET TRUE)14message(STATUS "Checking for required C++ features")16# Checks for Class Template Argument Deduction for aggregate types - used in src/util/overloaded.h17check_cxx_source_compiles("18#include <variant>20template<class... Ts> struct Overloaded : Ts... { using Ts::operator()...; };22int main() {23std::variant<int, double> v = 42;24return std::visit(Overloaded{25[](int) { return 0; },26[](double) { return 1; }27}, v);28}29" HAVE_CTAD_FOR_AGGREGATES)31if(NOT HAVE_CTAD_FOR_AGGREGATES)32message(FATAL_ERROR33"Compiler lacks Class Template Argument Deduction (CTAD) for aggregates.\n"34"This C++ feature is required for src/util/overloaded.h.\n"35"You are probably using an old compiler version\n"36"The recommended compiler versions can be checked in\n"37"doc/dependencies.md#compiler.\n"38)39endif()41message(STATUS "Checking for required C++ features - done")43endfunction()
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.