Range-v3 Range algorithms, views, and actions for the Standard Library |

Instances and minimal complete definitions | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ranges::view_facade< Derived, Cardinality > Struct Template Reference
Views

## 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`.

## Instances and minimal complete definitions
struct | view_as_cursor

## Public Member Functions
template<typename D = Derived>
constexpr 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>
constexpr 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. More...
template<typename D = Derived>
constexpr 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>
constexpr 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. More...

## Protected Member Functions
constexpr view_as_cursor | begin_cursor () const
constexpr default_sentinel_t | end_cursor () const

## Protected Attributes
friend | range_access

## Member Function Documentation

## ◆ begin() [1/2]

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

constexpr auto ranges::view_facade< Derived, Cardinality >::begin | ( |  | ) | -> detail::facade_iterator_t<D>
| constexpr

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)`

Precondition
  requires `same_as<D, Derived>`

## ◆ begin() [2/2]

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

constexpr auto ranges::view_facade< Derived, Cardinality >::begin | ( |  | ) | const -> detail::facade_iterator_t<D const>
| constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Precondition
  requires `same_as<D, Derived>`

## ◆ end() [1/2]

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

constexpr auto ranges::view_facade< Derived, Cardinality >::end | ( |  | ) | -> detail::facade_sentinel_t<D>
| constexpr

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`.

Precondition
  requires `same_as<D, Derived>`

## ◆ end() [2/2]

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

constexpr auto ranges::view_facade< Derived, Cardinality >::end | ( |  | ) | const -> detail::facade_sentinel_t<D const>
| constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Precondition
  requires `same_as<D, Derived>`