mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 23:00:55 +00:00
refactor: Act on TODOs that are unblocked by C++23 (#7990)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user