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) 2021-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_UTIL_OVERLOADED_H6#define BITCOIN_UTIL_OVERLOADED_H8namespace util {9//! Overloaded helper for std::visit. This helper and std::visit in general are10//! useful to write code that switches on a variant type. Unlike if/else-if and11//! switch/case statements, std::visit will trigger compile errors if there are12//! unhandled cases.13//!14//! Implementation comes from and example usage can be found at15//! https://en.cppreference.com/w/cpp/utility/variant/visit#Example16template<class... Ts> struct Overloaded : Ts... { using Ts::operator()...; };17} // namespace util19#endif // BITCOIN_UTIL_OVERLOADED_H