refactor: Act on TODOs that are unblocked by C++23 (#7990)

This commit is contained in:
Mayukha Vadari
2026-08-10 13:05:18 -04:00
committed by GitHub
parent a24caaa6ea
commit 71e972cbed
6 changed files with 29 additions and 61 deletions

View File

@@ -437,16 +437,10 @@ class Invariants_test : public beast::unit_test::Suite
XRPAmount{},
STTx{ttACCOUNT_DELETE, [](STObject& tx) {}});
for (auto const& keyletInfo : kDirectAccountKeylets)
for (auto const& [keyletfunc, type, includeInTests] : kDirectAccountKeylets)
{
// TODO: Use structured binding once LLVM 16 is the minimum
// supported version. See also:
// https://github.com/llvm/llvm-project/issues/48582
// https://github.com/llvm/llvm-project/commit/127bf44385424891eb04cff8e52d3f157fc2cb7c
if (!keyletInfo.includeInTests)
if (!includeInTests)
continue;
auto const& keyletfunc = keyletInfo.function;
auto const& type = keyletInfo.expectedLEName;
using namespace std::string_literals;

View File

@@ -43,6 +43,7 @@
#include <memory>
#include <mutex>
#include <optional>
#include <ranges>
#include <source_location>
#include <string>
#include <tuple>
@@ -315,19 +316,11 @@ auto const kData = JTxFieldWrapper<BlobField>(sfData);
auto const kAmount = JTxFieldWrapper<StAmountField>(sfAmount);
// TODO We only need this long "requires" clause as polyfill, for C++20
// implementations which are missing <ranges> header. Replace with
// `std::ranges::range<Input>`, and accordingly use std::ranges::begin/end
// when we have moved to better compilers.
template <typename Input>
template <std::ranges::range Input>
auto
makeVector(Input const& input)
requires requires(Input& v) {
std::begin(v);
std::end(v);
}
{
return std::vector(std::begin(input), std::end(input));
return std::vector(std::ranges::begin(input), std::ranges::end(input));
}
// Functions used in debugging