27namespace bio::ranges::detail
38 constexpr auto operator()(ptrdiff_t begin_pos, ptrdiff_t end_pos)
const noexcept
40 return detail::adaptor_from_functor{*
this, begin_pos, end_pos};
46 template <std::ranges::viewable_range urng_t>
47 constexpr auto operator()(urng_t && urange, ptrdiff_t begin_pos, ptrdiff_t end_pos)
const
49 if constexpr (std::ranges::sized_range<urng_t>)
51 begin_pos =
std::min(begin_pos,
static_cast<ptrdiff_t
>(std::ranges::size(urange)));
52 end_pos =
std::min(end_pos,
static_cast<ptrdiff_t
>(std::ranges::size(urange)));
55 if (end_pos < begin_pos)
56 throw std::invalid_argument{
"end_pos argument to bio::views::slice must be >= the begin_pos argument."};
58 return std::forward<urng_t>(urange) | std::views::drop(begin_pos) | std::views::take(end_pos - begin_pos) |
141inline constexpr auto slice = detail::slice_fn{};
constexpr auto type_reduce
A view adaptor that behaves like std::views::all, but type erases certain ranges.
Definition: type_reduce.hpp:152
constexpr auto slice
A view adaptor that returns a half-open interval on the underlying range.
Definition: slice.hpp:141
The BioC++ namespace for views.
Additional non-standard concepts for ranges.
Auxiliary header for the views submodule .
Provides bio::views::type_reduce.