From fa87f8feb76da42eeb5c4d32ee7be070b2bd559f Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Sat, 9 Dec 2023 14:55:01 +0100 Subject: [PATCH] doc: Clarify C++20 comments --- src/test/fuzz/fuzz.cpp | 4 ++-- src/util/overloaded.h | 4 ++-- src/util/types.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index 5245b4607bf..6de480ff154 100644 --- a/src/test/fuzz/fuzz.cpp +++ b/src/test/fuzz/fuzz.cpp @@ -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); } diff --git a/src/util/overloaded.h b/src/util/overloaded.h index 6be7453f813..5bb4b4e5636 100644 --- a/src/util/overloaded.h +++ b/src/util/overloaded.h @@ -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 struct Overloaded : Ts... { using Ts::operator()...; }; -//! Explicit deduction guide (not needed as of C++20) +//! Explicit deduction guide (not needed after clang-17) template Overloaded(Ts...) -> Overloaded; } // namespace util diff --git a/src/util/types.h b/src/util/types.h index 0047b00026b..e930216aea1 100644 --- a/src/util/types.h +++ b/src/util/types.h @@ -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 inline constexpr bool ALWAYS_FALSE{false};