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 ca53ef8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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)
{
std::begin(v);
std::end(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 iterable<Input>
make_vector(Input const& input)
requires requires(Input& v) {
std::begin(v);
std::end(v);
}
{
return std::vector(std::begin(input), std::end(input));
}
Expand Down

0 comments on commit ca53ef8

Please sign in to comment.