Skip to content

Commit

Permalink
Remove named concept iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Oct 30, 2023
1 parent ee53c5d commit 5b425a5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/test/jtx/TestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ namespace ripple {
namespace test {
namespace jtx {

// Helper to make vector from iterable
template <typename T>
concept iterable = requires(T& v)
// 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(Input const& input) requires requires(Input& v)
{
std::begin(v);
std::end(v);
};

template <typename Input>
auto
make_vector(Input const& input) requires iterable<Input>
}
{
return std::vector(std::begin(input), std::end(input));
}
Expand Down

0 comments on commit 5b425a5

Please sign in to comment.