Skip to content

Commit

Permalink
Merge branch 'develop' into nft-reserve
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 authored Oct 30, 2023
2 parents 809b001 + ac02e56 commit c41e18d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/test/jtx/TestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,25 @@
#include <ripple/protocol/jss.h>
#include <test/jtx/Env.h>

#include <ranges>
#include <vector>

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 <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>
auto
make_vector(auto const& input) requires std::ranges::range<decltype(input)>
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
Expand Down

0 comments on commit c41e18d

Please sign in to comment.