From 63415cf53430f28388d98b6aa94ccd6983cdb6a4 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Thu, 19 Feb 2026 18:00:21 +0900 Subject: [PATCH] fix: remove include (#4788) Remove dependency on `` header, since it is not implemented by all compilers which we want to support. This code change only affects unit tests. Resolve https://github.com/XRPLF/rippled/issues/4787 --- src/test/jtx/TestHelpers.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index b61184430..f00d06dfc 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -27,19 +27,25 @@ #include #include -#include #include namespace ripple { namespace test { namespace jtx { -// Helper to make vector from iterable +// TODO We only need this long "requires" clause as polyfill, for C++20 +// implementations which are missing header. Replace with +// `std::ranges::range`, and accordingly use std::ranges::begin/end +// when we have moved to better compilers. +template auto -make_vector(auto const& input) - requires std::ranges::range +make_vector(Input const& input) requires requires(Input& v) { - return std::vector(std::ranges::begin(input), std::ranges::end(input)); + std::begin(v); + std::end(v); +} +{ + return std::vector(std::begin(input), std::end(input)); } // Functions used in debugging