5 #ifndef VCCC_RANGES_VIEW_INTERFACE_HPP_
6 #define VCCC_RANGES_VIEW_INTERFACE_HPP_
36 template<
typename T,
typename =
void>
37 struct is_empty_callable : std::false_type {};
40 struct is_empty_callable<T,
void_t<decltype( ranges::
empty(std::declval<T>()) )>> : std::true_type {};
42 template<
typename T,
bool = has_
typename_type<iterator<T>>::value>
43 struct check_vi_data : std::false_type {};
45 struct check_vi_data<T, true> : contiguous_iterator<iterator_t<T>> {};
52 has_typename_type<iterator<T>>,
53 has_typename_type<sentinel<T>>
56 struct check_vi_size : std::false_type {};
59 struct check_vi_size<T, true> : sized_sentinel_for<sentinel_t<T>, iterator_t<T>> {};
77 template<
typename Derived>
81 "Constraints not satisfied");
91 template<
typename D = Derived, std::enable_if_t<
98 template<
typename D = Derived, std::enable_if_t<
conjunction<
107 template<
typename D = Derived, std::enable_if_t<
114 template<
typename D = Derived, std::enable_if_t<
conjunction<
160 template<
typename D = Derived, std::enable_if_t<
163 constexpr
explicit operator bool() {
167 template<
typename D = Derived, std::enable_if_t<
170 constexpr
explicit operator bool()
const {
181 template<
typename D = Derived, std::enable_if_t<
187 template<
typename D = Derived, std::enable_if_t<
203 template<
typename D = Derived, std::enable_if_t<
210 template<
typename D = Derived, std::enable_if_t<
227 template<
typename D = Derived, std::enable_if_t<
233 template<
typename D = Derived, std::enable_if_t<
236 constexpr decltype(
auto)
front()
const {
251 template<
typename D = Derived, std::enable_if_t<
conjunction<
255 constexpr decltype(
auto)
back() {
258 template<
typename D = Derived, std::enable_if_t<
conjunction<
262 constexpr decltype(
auto)
back()
const {
276 template<
typename R = Derived, std::enable_if_t<
282 template<
typename R =
const Derived, std::enable_if_t<
291 constexpr
const Derived& derived()
const {
292 return static_cast<const Derived&
>(*this);
295 constexpr Derived& derived() {
296 return static_cast<Derived&
>(*this);
helper class template for defining a view, using the curiously recurring template pattern
Definition: view_interface.hpp:78
constexpr auto size() const
Definition: view_interface.hpp:213
constexpr auto size()
Definition: view_interface.hpp:206
constexpr auto cbegin()
Definition: view_interface.hpp:129
Derived $vccc_derived
Definition: view_interface.hpp:84
constexpr auto cend()
Definition: view_interface.hpp:145
constexpr bool empty() const
Definition: view_interface.hpp:110
constexpr decltype(auto) back()
Definition: view_interface.hpp:255
constexpr auto data() const
Definition: view_interface.hpp:190
constexpr auto cbegin() const
Definition: view_interface.hpp:134
constexpr auto cend() const
Definition: view_interface.hpp:150
constexpr auto data()
Definition: view_interface.hpp:184
constexpr bool empty()
Definition: view_interface.hpp:94
constexpr decltype(auto) front()
Definition: view_interface.hpp:230
constexpr VCCC_INLINE_OR_STATIC detail::prev_niebloid prev
Definition: prev.hpp:53
constexpr T * to_address(T *p) noexcept
Definition: to_address.hpp:37
constexpr VCCC_INLINE_OR_STATIC detail::empty_niebloid empty
checks whether a range is empty
Definition: empty.hpp:116
constexpr VCCC_INLINE_OR_STATIC detail::cbegin_niebloid cbegin
returns an iterator to the beginning of a read-only range
Definition: cbegin.hpp:46
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
constexpr VCCC_INLINE_OR_STATIC detail::cend_niebloid cend
returns a sentinel indicating the end of a read-only range
Definition: cend.hpp:46
Definition: cxx20_rel_ops.hpp:17
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: conjunction.hpp:22
Definition: negation.hpp:23
specifies a range whose iterator type satisfies bidirectional_iterator
Definition: bidirectional_range.hpp:49
Definition: common_range.hpp:41
specifies a range whose iterator type satisfies forward_iterator
Definition: forward_range.hpp:47
specifies a range whose iterator type satisfies random_access_iterator
Definition: random_access_range.hpp:48
specifies that a range knows its size in constant time
Definition: sized_range.hpp:38