mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Merge bitcoin/bitcoin#29042: doc: Clarify C++20 comments
fa87f8feb7
doc: Clarify C++20 comments (MarcoFalke) Pull request description: Turns out "class template argument deduction for aggregates" is one of the few things implemented only in recent compilers, see https://en.cppreference.com/w/cpp/compiler_support/20 So clarify the comments. ACKs for top commit: hebasto: ACKfa87f8feb7
, I verified the code with clang-{16,17}. Tree-SHA512: f6d20f946cb6f8e34db224e074ed8f9dfa598377c066d1b58a8feb9e64d007444f1e2c0399e91a3e282fd5d59f90e0d7df90aa3956824d96bc78070ee12f603c
This commit is contained in:
commit
7c248b972b
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2009-2022 The Bitcoin Core developers
|
||||
// Copyright (c) 2009-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@ -71,7 +71,7 @@ auto& FuzzTargets()
|
||||
|
||||
void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target, FuzzTargetOptions opts)
|
||||
{
|
||||
const auto it_ins{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped in C++20 */ {std::move(target), std::move(opts)})};
|
||||
const auto it_ins{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped after clang-16 */ {std::move(target), std::move(opts)})};
|
||||
Assert(it_ins.second);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2021 The Bitcoin Core developers
|
||||
// Copyright (c) 2021-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@ -15,7 +15,7 @@ namespace util {
|
||||
//! https://en.cppreference.com/w/cpp/utility/variant/visit#Example
|
||||
template<class... Ts> struct Overloaded : Ts... { using Ts::operator()...; };
|
||||
|
||||
//! Explicit deduction guide (not needed as of C++20)
|
||||
//! Explicit deduction guide (not needed after clang-17)
|
||||
template<class... Ts> Overloaded(Ts...) -> Overloaded<Ts...>;
|
||||
} // namespace util
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef BITCOIN_UTIL_TYPES_H
|
||||
#define BITCOIN_UTIL_TYPES_H
|
||||
|
||||
// Not needed after C++23 (DR, https://cplusplus.github.io/CWG/issues/2518.html)
|
||||
template <class>
|
||||
inline constexpr bool ALWAYS_FALSE{false};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user