Skip to content

Commit

Permalink
[FIX] gcc-11: std::views::drop expects std::ranges::range_difference_…
Browse files Browse the repository at this point in the history
…t<urng_t> (#2528)

* [FIX] gcc-11: std::views::drop expects std::ranges::range_difference_t<urng_t>

```
seqan3/include/seqan3/range/views/drop.hpp:95:49: error: no match for ‘operator|’ (operand types are ‘std::ranges::ref_view<std::__cxx11::list<seqan3::dna4> >’ and ‘std::ranges::views::__adaptor::_Partial<std::ranges::views::_Drop, long unsigned int>’)
   95 |             return std::forward<urng_t>(urange) | std::views::drop(drop_size);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

* Apply suggestions from code review
  • Loading branch information
marehr authored Apr 20, 2021
1 parent 92e5067 commit c468426
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/seqan3/range/views/drop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ struct drop_fn
// std::views::drop
else
{
return std::forward<urng_t>(urange) | std::views::drop(drop_size);
using drop_size_t = std::ranges::range_difference_t<urng_t>;
// urange | std::views::drop(drop_size);
return std::views::drop(std::forward<urng_t>(urange), static_cast<drop_size_t>(drop_size));
}
}
};
Expand Down

1 comment on commit c468426

@vercel
Copy link

@vercel vercel bot commented on c468426 Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.