Skip to content

Commit 7c248b9

Browse files
committed
Merge bitcoin/bitcoin#29042: doc: Clarify C++20 comments
fa87f8f 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 fa87f8f, I verified the code with clang-{16,17}. Tree-SHA512: f6d20f946cb6f8e34db224e074ed8f9dfa598377c066d1b58a8feb9e64d007444f1e2c0399e91a3e282fd5d59f90e0d7df90aa3956824d96bc78070ee12f603c
2 parents c80f57b + fa87f8f commit 7c248b9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/test/fuzz/fuzz.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2009-2022 The Bitcoin Core developers
1+
// Copyright (c) 2009-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

@@ -71,7 +71,7 @@ auto& FuzzTargets()
7171

7272
void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target, FuzzTargetOptions opts)
7373
{
74-
const auto it_ins{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped in C++20 */ {std::move(target), std::move(opts)})};
74+
const auto it_ins{FuzzTargets().try_emplace(name, FuzzTarget /* temporary can be dropped after clang-16 */ {std::move(target), std::move(opts)})};
7575
Assert(it_ins.second);
7676
}
7777

src/util/overloaded.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021 The Bitcoin Core developers
1+
// Copyright (c) 2021-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

@@ -15,7 +15,7 @@ namespace util {
1515
//! https://en.cppreference.com/w/cpp/utility/variant/visit#Example
1616
template<class... Ts> struct Overloaded : Ts... { using Ts::operator()...; };
1717

18-
//! Explicit deduction guide (not needed as of C++20)
18+
//! Explicit deduction guide (not needed after clang-17)
1919
template<class... Ts> Overloaded(Ts...) -> Overloaded<Ts...>;
2020
} // namespace util
2121

src/util/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef BITCOIN_UTIL_TYPES_H
66
#define BITCOIN_UTIL_TYPES_H
77

8+
// Not needed after C++23 (DR, https://cplusplus.github.io/CWG/issues/2518.html)
89
template <class>
910
inline constexpr bool ALWAYS_FALSE{false};
1011

0 commit comments

Comments
 (0)