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:
    ACK fa87f8feb7, I verified the code with clang-{16,17}.

Tree-SHA512: f6d20f946cb6f8e34db224e074ed8f9dfa598377c066d1b58a8feb9e64d007444f1e2c0399e91a3e282fd5d59f90e0d7df90aa3956824d96bc78070ee12f603c
This commit is contained in:
fanquake 2024-01-05 15:36:57 +00:00
commit 7c248b972b
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
3 changed files with 5 additions and 4 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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};