diff --git a/src/test/jtx/TestHelpers.h b/src/test/jtx/TestHelpers.h index 2bee47a6411..b065cec470a 100644 --- a/src/test/jtx/TestHelpers.h +++ b/src/test/jtx/TestHelpers.h @@ -27,17 +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