5 #ifndef VCCC_RANGES_VIEWS_DROP_HPP
6 #define VCCC_RANGES_VIEWS_DROP_HPP
10 #include <type_traits>
35 using vccc::detail::return_category;
41 struct return_category_empty_view : std::true_type {
42 using category = return_category<1, decltype(vccc_decay_copy(std::declval<R>()))>;
44 template<
typename R,
typename T,
typename D>
45 struct return_category_empty_view<R, T, D, false> : std::false_type {
46 using category = return_category<0>;
48 template<
typename R,
typename D,
typename RT>
49 constexpr RT operator()(R&& r, D, return_category<1, RT>)
const {
50 return std::forward<R>(r);
54 template<
typename T,
bool = conjunction<ranges::detail::is_subrange<T>, random_access_range<T>, sized_range<T>>::value >
55 struct return_category_subrange : std::true_type {
62 struct return_category_subrange<T, false> : std::false_type {
63 using category = return_category<0>;
66 template<
typename R,
typename D,
typename U>
67 constexpr U operator()(R&&
e, D f, return_category<2, U>)
const {
78 struct is_span : std::false_type {};
79 template<
typename T, std::
size_t Extent>
80 struct is_span<
span<T, Extent>> : std::true_type {};
83 struct return_category_span : std::true_type {
84 using category = return_category<3, span<typename T::element_type>>;
86 template<
typename T,
typename D>
87 struct return_category_span<T, D, false> : std::false_type {
88 using category = return_category<0>;
93 struct return_category_string_view : std::true_type {
94 using category = return_category<3, T>;
97 struct return_category_string_view<T, false> : std::false_type {
98 using category = return_category<0>;
103 struct return_category_iota_view : std::true_type {
104 using category = return_category<3, T>;
107 struct return_category_iota_view<T, false> : std::false_type {
108 using category = return_category<0>;
111 template<
typename R,
typename D,
typename U>
112 constexpr U operator()(R&&
e, D f, return_category<3, U>)
const {
124 template<
typename R,
typename D>
125 constexpr
auto operator()(R&&
e, D f, return_category<4>, std::true_type )
const {
128 template<
typename R,
typename D>
129 constexpr
auto operator()(R&&
e, D, return_category<4>, std::false_type )
const {
132 template<
typename R,
typename D>
133 constexpr
auto operator()(R&&
e, D f, return_category<4>)
const {
137 template<
typename R,
typename D>
142 template<
typename R,
typename T,
typename D>
165 return (*
this)(std::forward<R>(r),
count, category<R&&, T, D>{});
168 template<
typename DifferenceType>
Definition: drop_view.hpp:66
Definition: range_adaptor.hpp:25
a non-owning view over a contiguous sequence of objects
Definition: span.hpp:118
#define vccc_decay_copy(x)
Definition: decay_copy.hpp:12
constexpr VCCC_INLINE_OR_STATIC detail::count_niebloid count
Definition: count.hpp:58
constexpr T e
the mathematical constant
Definition: constants.hpp:37
typename sentinel< R >::type sentinel_t
Definition: sentinel_t.hpp:29
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::repeat_niebloid repeat
Definition: repeat.hpp:56
constexpr VCCC_INLINE_OR_STATIC detail::distance_niebloid distance
Definition: distance.hpp:72
constexpr VCCC_INLINE_OR_STATIC detail::drop_niebloid drop
Definition: drop.hpp:179
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
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: is_specialization.hpp:30
specifies that a range knows its size in constant time
Definition: sized_range.hpp:38
constexpr auto operator()(DifferenceType &&count) const
Definition: drop.hpp:169
constexpr auto operator()(R &&r, range_difference_t< R > count) const
Definition: drop.hpp:162