ranges::view_facade< Derived, Cardinality > Struct Template Reference
Views

A utility for constructing a view from a (derived) type that implements begin and end cursors. More...

`#include <range/v3/view/facade.hpp>`

Inheritance diagram for ranges::view_facade< Derived, Cardinality >:

## Classes

struct | view_as_cursor

## Public Member Functions

template<typename D = Derived>
CPP_TEMPLATE_AUX_0 | c (requires same_as< D, Derived >) ccconstexpr auto begin() -> detail::facade_iterator_t< D >
| Let `d` be `static_cast<Derived &>(*this)`. Let `b` be `std::as_const(d).begin_cursor()` if that expression is well-formed; otherwise, let `b` be `d.begin_cursor()`. Let `B` be the type of `b`. More...
template<typename D = Derived>
CPP_TEMPLATE_AUX_0 | c (requires same_as< D, Derived >) ccconstexpr auto begin() const -> detail::facade_iterator_t< D const >
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename D = Derived>
CPP_TEMPLATE_AUX_0 | c (requires same_as< D, Derived >) ccconstexpr auto end() -> detail::facade_sentinel_t< D >
| Let `d` be `static_cast<Derived &>(*this)`. Let `e` be `std::as_const(d).end_cursor()` if that expression is well-formed; otherwise, let `e` be `d.end_cursor()`. Let `E` be the type of `e`. More...
template<typename D = Derived>
CPP_TEMPLATE_AUX_0 | c (requires same_as< D, Derived >) ccconstexpr auto end() const -> detail::facade_sentinel_t< D const >
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Public Member Functions inherited from ranges::view_interface< Derived, Cardinality >
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&(!detail::has_fixed_size_< Cardinality >) &&forward_range< D< True > const >) ccconstexpr bool empty() const noexcept(noexcept(bool(ranges::begin(std::declval< D< True > const & >())==ranges::end(std::declval< D< True > const & >()))))
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&(!detail::has_fixed_size_< Cardinality >) &&forward_range< D< True >>) ccconstexpr bool empty() noexcept(noexcept(bool(ranges::begin(std::declval< D< True > & >())==ranges::end(std::declval< D< True > & >()))))
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&(Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True > const >) &&sized_range< D< True > const >) ccconstexpr bool empty() const noexcept(noexcept(bool(ranges::size(std::declval< D< True > const & >())==0)))
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&(Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True >>) &&sized_range< D< True >>) ccconstexpr bool empty() noexcept(noexcept(bool(ranges::size(std::declval< D< True > & >())==0)))
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&(Cardinality< 0) &&sized_sentinel_for< sentinel_t< D< True > const >, iterator_t< D< True > const >> &&forward_range< D< True > const >) ccconstexpr detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&common_range< D< True > const > &&bidirectional_range< D< True > const >) ccconstexpr range_reference_t< D< True > const > back() const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&common_range< D< True >> &&bidirectional_range< D< True >>) ccconstexpr range_reference_t< D< True >> back()
| Access the last element in a range:
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&contiguous_iterator< iterator_t< D< True > const >>) ccconstexpr std
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&contiguous_iterator< iterator_t< D< True >>>) ccconstexpr std
| Returns a pointer to the block of memory containing the elements of a contiguous range:
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&forward_range< D< True > const >) ccconstexpr range_reference_t< D< True > const > front() const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&forward_range< D< True >>) ccconstexpr range_reference_t< D< True >> front()
| Access the first element in a range:
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True > & > &&sized_range< D< True > & >) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True > & >) ccconstexpr auto operator[](detail
| Python-ic slicing:
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True > & >) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True > const & > &&sized_range< D< True > const & >) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True > const & >) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True > const & >) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True >> &&sized_range< D< True >>) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True >>) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
CPP_TEMPLATE_AUX_0 | c (requires True &&input_range< D< True >>) ccconstexpr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&random_access_range< D< True > const > &&sized_range< D< True > const >) ccconstexpr range_reference_t< D< True > const > at(range_difference_t< D< True >> n) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&random_access_range< D< True > const >) ccconstexpr range_reference_t< D< True > const > operator[](range_difference_t< D< True >> n) const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&random_access_range< D< True >> &&sized_range< D< True >>) ccconstexpr range_reference_t< D< True >> at(range_difference_t< D< True >> n)
| Returns a reference to the element at specified location pos, with bounds checking.
template<bool True = true>
CPP_TEMPLATE_AUX_0 | c (requires True &&random_access_range< D< True >>) ccconstexpr range_reference_t< D< True >> operator[](range_difference_t< D< True >> n)
| Simple indexing:
template<bool True = true, int = 42>
| CPP_TEMPLATE_AUX_0 (requires True &&(Cardinality >=0)) static const expr std
| If the size of the range is known at compile-time and finite, return it.
template<bool True = true, typename Slice = views::slice_fn>
| CPP_TEMPLATE_AUX_0 (requires True &&(forward_range< D< True > & >||(input_range< D< True > & > &&sized_range< D< True > & >))) const expr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
| CPP_TEMPLATE_AUX_0 (requires True &&(forward_range< D< True > & >||(input_range< D< True > & > &&sized_range< D< True > & >))) const expr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
| CPP_TEMPLATE_AUX_0 (requires True &&(forward_range< D< True > const & >||(input_range< D< True > const & > &&sized_range< D< True > const & >))) const expr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
| CPP_TEMPLATE_AUX_0 (requires True &&(forward_range< D< True > const & >||(input_range< D< True > const & > &&sized_range< D< True > const & >))) const expr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
| CPP_TEMPLATE_AUX_0 (requires True &&(forward_range< D< True >>||(input_range< D< True >> &&sized_range< D< True >>))) const expr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true, typename Slice = views::slice_fn>
| CPP_TEMPLATE_AUX_0 (requires True &&(forward_range< D< True >>||(input_range< D< True >> &&sized_range< D< True >>))) const expr auto operator[](detail
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
| CPP_TEMPLATE_AUX_0 (requires True &&detail::can_empty_< D< True > const >) const expr explicit operator bool() const noexcept(noexcept(ranges::empty(std::declval< D< True > const & >())))
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<bool True = true>
| CPP_TEMPLATE_AUX_0 (requires True &&detail::can_empty_< D< True >>) const expr explicit operator bool() noexcept(noexcept(ranges::empty(std::declval< D< True > & >())))
constexpr auto | empty () const noexcept -> bool requires(detail::has_fixed_size_< Cardinality >)
| Test whether a range can be empty:
view_interface & | operator= (view_interface &&)=default
view_interface & | operator= (view_interface const &)=default
| view_interface (view_interface &&)=default
| view_interface (view_interface const &)=default

## Protected Member Functions

constexpr view_as_cursor | begin_cursor () const
constexpr default_sentinel_t | end_cursor () const
Protected Member Functions inherited from ranges::view_interface< Derived, Cardinality >
constexpr Derived const & | derived () const noexcept
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
constexpr Derived & | derived () noexcept

## Protected Attributes

friend | range_access

## Additional Inherited Members

Protected Types inherited from ranges::view_interface< Derived, Cardinality >
template<bool B>
using | D = meta::invoke< detail::dependent_< B >, Derived >

## Detailed Description

### template<typename Derived, cardinality Cardinality>
struct ranges::view_facade< Derived, Cardinality >

A utility for constructing a view from a (derived) type that implements begin and end cursors.

Template Parameters

  Derived | A type that derives from `view_facade` and implements begin and end cursors. This type is permitted to be incomplete.
  Cardinality | The cardinality of this view: `finite`, `infinite`, or `unknown`. See `ranges::cardinality`.

## Member Function Documentation

## c() [1/2]

template<typename Derived , cardinality Cardinality>
template<typename D = Derived>

CPP_TEMPLATE_AUX_0 ranges::view_facade< Derived, Cardinality >::c | ( | requires same_as< D, Derived > |  | ) | -> detail::facade_iterator_t<D>

Let `d` be `static_cast<Derived &>(*this)`. Let `b` be `std::as_const(d).begin_cursor()` if that expression is well-formed; otherwise, let `b` be `d.begin_cursor()`. Let `B` be the type of `b`.

Returns
  `ranges::basic_iterator<B>(b)`

## c() [2/2]

template<typename Derived , cardinality Cardinality>
template<typename D = Derived>

CPP_TEMPLATE_AUX_0 ranges::view_facade< Derived, Cardinality >::c | ( | requires same_as< D, Derived > |  | ) | -> detail::facade_sentinel_t<D>

Let `d` be `static_cast<Derived &>(*this)`. Let `e` be `std::as_const(d).end_cursor()` if that expression is well-formed; otherwise, let `e` be `d.end_cursor()`. Let `E` be the type of `e`.

Returns
  `ranges::basic_iterator<E>(e)` if `E` is the same as `B` computed above for `begin()`; otherwise, return `e`.