5 #ifndef VCCC_RANGES_VIEWS_DROP_VIEW_HPP
6 #define VCCC_RANGES_VIEWS_DROP_VIEW_HPP
33 template<
typename V,
bool = conjunction<simple_view<V>, sized_range<V>, random_access_range<V> >::value >
34 class drop_view_cached_begin {
37 constexpr
auto begin(
const V& base, range_difference_t<V>
count)
const {
43 class drop_view_cached_begin<V, false> {
46 constexpr
auto begin(
const V& base, range_difference_t<V>
count) {
47 if (!begin_.has_value()) {
54 optional<iterator_t<V>> begin_;
65 ,
public detail::drop_view_cached_begin<V>
67 using begin_base = detail::drop_view_cached_begin<V>;
79 constexpr V
base() const& noexcept(
std::is_nothrow_copy_constructible<V>::
value) {
84 return std::move(base_);
87 template<
typename V2 = V, std::enable_if_t<
conjunction<
96 template<
typename V2 = V, std::enable_if_t<
conjunction<
110 constexpr
auto end()
const {
117 const auto c =
static_cast<decltype(s)
>(count_);
118 return s < c ? 0 : s - c;
124 const auto c =
static_cast<decltype(s)
>(count_);
125 return s < c ? 0 : s - c;
134 constexpr drop_view<views::all_t<R>>
139 #if __cplusplus >= 201703L
142 drop_view(R&&, range_difference_t<R>) -> drop_view<views::all_t<R>>;
Definition: drop_view.hpp:66
constexpr V base() const &noexcept(std::is_nothrow_copy_constructible< V >::value)
Definition: drop_view.hpp:79
constexpr auto size() const
Definition: drop_view.hpp:122
constexpr auto size()
Definition: drop_view.hpp:115
constexpr auto end()
Definition: drop_view.hpp:105
constexpr auto end() const
Definition: drop_view.hpp:110
constexpr auto begin() const
Definition: drop_view.hpp:100
constexpr drop_view(V base, range_difference_t< V > count)
Definition: drop_view.hpp:74
constexpr V base() &&noexcept(std::is_nothrow_move_constructible< V >::value)
Definition: drop_view.hpp:83
constexpr auto begin()
Definition: drop_view.hpp:92
helper class template for defining a view, using the curiously recurring template pattern
Definition: view_interface.hpp:78
constexpr VCCC_INLINE_OR_STATIC detail::count_niebloid count
Definition: count.hpp:58
constexpr VCCC_INLINE_OR_STATIC detail::next_niebloid next
Definition: next.hpp:65
constexpr drop_view< views::all_t< R > > make_drop_view(R &&r, range_difference_t< R > count)
Definition: drop_view.hpp:135
constexpr VCCC_INLINE_OR_STATIC detail::begin_niebloid begin
returns an iterator to the beginning of a range
Definition: begin.hpp:116
constexpr VCCC_INLINE_OR_STATIC detail::size_niebloid size
returns the size of a container or array
Definition: size.hpp:145
constexpr VCCC_INLINE_OR_STATIC detail::end_niebloid end
returns a sentinel indicating the end of a range
Definition: end.hpp:120
typename range_difference< R >::type range_difference_t
Used to obtain the difference type of the iterator type of range type R.
Definition: range_difference_t.hpp:41
Definition: matrix.hpp:495
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: conjunction.hpp:22
Definition: enable_borrowed_range.hpp:17
specifies a range whose iterator type satisfies random_access_iterator
Definition: random_access_range.hpp:48
Definition: simple_view.hpp:28
specifies that a range knows its size in constant time
Definition: sized_range.hpp:38
specifies that a range is a view, that is, it has constant time copy/move/assignment
Definition: view.hpp:31