14#ifndef RANGES_V3_VIEW_DROP_EXACTLY_HPP
15#define RANGES_V3_VIEW_DROP_EXACTLY_HPP
30#include <range/v3/utility/static_const.hpp>
36#include <range/v3/detail/prologue.hpp>
42 template<
typename Rng>
45 is_finite<Rng>::value ? finite : range_cardinality<Rng>::value>
46 ,
private detail::non_propagating_cache<iterator_t<Rng>, drop_exactly_view<Rng>,
47 !random_access_range<Rng>>
50 using difference_type_ = range_difference_t<Rng>;
55 template(
bool Const =
true)(
59 return next(ranges::begin(rng_), n_);
63 return next(ranges::begin(rng_), n_);
70 auto & begin_ =
static_cast<cache_t &
>(*this);
72 begin_ = next(ranges::begin(rng_), n_);
79 : rng_(std::move(rng))
82 RANGES_EXPECT(n >= 0);
90 return ranges::end(rng_);
92 template(
bool Const =
true)(
96 return this->get_begin_(std::true_type{});
98 template(
bool Const =
true)(
100 sentinel_t<meta::const_if_c<Const, Rng>> end()
const
102 return ranges::end(rng_);
105 auto CPP_fun(
size)()(
const
108 return ranges::size(rng_) -
static_cast<range_size_t<Rng const>
>(n_);
111 auto CPP_fun(
size)()(
114 return ranges::size(rng_) -
static_cast<range_size_t<Rng>
>(n_);
122 template<
typename Rng>
123 RANGES_INLINE_VAR
constexpr bool enable_borrowed_range<drop_exactly_view<Rng>> =
124 enable_borrowed_range<Rng>;
126#if RANGES_CXX_DEDUCTION_GUIDES >= RANGES_CXX_DEDUCTION_GUIDES_17
127 template<
typename Rng>
129 ->drop_exactly_view<views::all_t<Rng>>;
137 template<
typename Rng>
138 static auto impl_(Rng && rng, range_difference_t<Rng> n,
input_range_tag)
141 return {all(
static_cast<Rng &&
>(rng)), n};
143 template(
typename Rng)(
148 return {begin(rng) + n, end(rng)};
152 template(
typename Rng)(
154 auto operator()(Rng && rng, range_difference_t<Rng> n)
const
156 return drop_exactly_base_fn::impl_(
157 static_cast<Rng &&
>(rng), n, range_tag_of<Rng>{});
163 using drop_exactly_base_fn::operator();
165 template(
typename Int)(
166 requires detail::integer_like_<Int>)
167 constexpr auto operator()(Int n)
const
180#include <range/v3/detail/epilogue.hpp>
181#include <range/v3/detail/satisfy_boost_range.hpp>
The borrowed_range concept.
The random_access_range concept.
The viewable_range concept.
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector > >, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
std::integral_constant< bool, B > bool_
An integral constant wrapper for bool.
Definition: meta.hpp:168
defer< bind_back, Fn, Ts... > bind_back
Definition: meta.hpp:994
meta::size_t< L::size()> size
An integral constant wrapper that is the size of the meta::list L.
Definition: meta.hpp:1696
Definition: drop_exactly.hpp:48
Definition: concepts.hpp:277
Definition: subrange.hpp:196
Definition: interface.hpp:129
Definition: drop_exactly.hpp:135
Definition: drop_exactly.hpp:162