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

Friends | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | List of all members
ranges::view_interface< Derived, Cardinality > Struct Template Reference
Views
Inheritance diagram for ranges::view_interface< Derived, Cardinality >:

## Friends
template<bool True = true>
auto | operator<< (std::ostream &sout, Derived &&rng) -> std::ostream &
| 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>
auto | operator<< (std::ostream &sout, Derived &rng) -> std::ostream &
| 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>
auto | operator<< (std::ostream &sout, Derived const &rng) -> std::ostream &
| Print a range to an ostream.

## Public Member Functions
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr range_reference_t< D< True > > | back ()
| Access the last element in a range: More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr std::add_pointer_t< range_reference_t< D< True > > > | data ()
| Returns a pointer to the block of memory containing the elements of a contiguous range: More...
template<bool True = true>
constexpr std::add_pointer_t< range_reference_t< D< True > const > > | data () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
constexpr auto | empty () const noexcept -> bool
| Test whether a range can be empty:
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr range_reference_t< D< True > > | front ()
| Access the first element in a range: More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr | 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. More...
template<bool True = true>
constexpr | operator bool () noexcept(noexcept(ranges::empty(std::declval< D< True > & >())))
view_interface & | operator= (view_interface &&)=default
view_interface & | operator= (view_interface const &)=default
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< detail::from_end_of_t< D< True >>, detail::from_end_of_t< D< True >>> offs) &
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< detail::from_end_of_t< D< True >>, detail::from_end_of_t< D< True >>> offs) &&
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< detail::from_end_of_t< D< True >>, detail::from_end_of_t< D< True >>> offs) 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<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< detail::from_end_of_t< D< True >>, end_fn > offs) &
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< detail::from_end_of_t< D< True >>, end_fn > offs) &&
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< detail::from_end_of_t< D< True >>, end_fn > offs) 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<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> offs) &
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> offs) &&
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> offs) 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<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>, end_fn > offs) &
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>, end_fn > offs) &&
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>, end_fn > offs) 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<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>> offs) &
| Python-ic slicing: More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>> offs) &&
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<bool True = true, typename Slice = views::slice_fn>
constexpr auto | operator[] (detail::slice_bounds< range_difference_t< D< True >>> offs) 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<bool True = true>
constexpr range_reference_t< D< True > > | operator[] (range_difference_t< D< True >> n)
| Simple indexing: More...
template<bool True = true>
constexpr 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. More...
template<bool True = true>
constexpr detail::iter_size_t< iterator_t< D< True > > > | size ()
| If `sized_sentinel_for<sentinel_t<Derived>, iterator_t<Derived>>` is satisfied, and if `Derived` is a `forward_range`, then return `end - begin` cast to an unsigned integer. More...
template<bool True = true>
constexpr detail::iter_size_t< iterator_t< D< True > > > | size () const
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
| view_interface (view_interface &&)=default
| view_interface (view_interface const &)=default

## Static Public Member Functions
template<bool True = true, int = 42>
static constexpr std::size_t | size () noexcept
| If the size of the range is known at compile-time and finite, return it. More...

## Protected Types
template<bool B>
using | D = meta::invoke< detail::dependent_< B >, Derived >

## Protected Member Functions
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

## Member Function Documentation

## ◆ at() [1/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> > ranges::view_interface< Derived, Cardinality >::at | ( | range_difference_t< D< True >> | n | ) |
| constexpr

Returns a reference to the element at specified location pos, with bounds checking.

Precondition
  requires `True && random_access_range<D<True>> && sized_range<D<True>>`

## ◆ at() [2/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> const> ranges::view_interface< Derived, Cardinality >::at | ( | range_difference_t< D< True >> | n | ) | 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 `True && random_access_range<D<True> const> && sized_range<D<True> const>`

## ◆ back() [1/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> > ranges::view_interface< Derived, Cardinality >::back | ( |  | ) |
| constexpr

Access the last element in a range:

Precondition
  requires `True && common_range<D<True>> && bidirectional_range<D<True>>`

## ◆ back() [2/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> const> ranges::view_interface< Derived, Cardinality >::back | ( |  | ) | 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 `True && common_range<D<True> const> && bidirectional_range<D<True> const>`

## ◆ data() [1/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr std::add_pointer_t<range_reference_t<D<True> > > ranges::view_interface< Derived, Cardinality >::data | ( |  | ) |
| constexpr

Returns a pointer to the block of memory containing the elements of a contiguous range:

Precondition
  requires `True && contiguous_iterator<iterator_t<D<True>>>`

## ◆ data() [2/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr std::add_pointer_t<range_reference_t<D<True> const> > ranges::view_interface< Derived, Cardinality >::data | ( |  | ) | 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 `True && contiguous_iterator<iterator_t<D<True> const>>`

## ◆ empty() [1/4]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr bool ranges::view_interface< Derived, Cardinality >::empty | ( |  | ) | const
| constexpr noexcept

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

Precondition
  requires `True && (!detail::has_fixed_size_<Cardinality>) && forward_range<D<True> const>`

## ◆ empty() [2/4]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr bool ranges::view_interface< Derived, Cardinality >::empty | ( |  | ) | const
| constexpr noexcept

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

Precondition
  requires `True && (Cardinality < 0) && (Cardinality != infinite) && (!forward_range<D<True> const>) && sized_range<D<True> const>`

## ◆ empty() [3/4]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr bool ranges::view_interface< Derived, Cardinality >::empty | ( |  | ) |
| constexpr noexcept

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

Precondition
  requires `True && (!detail::has_fixed_size_<Cardinality>) && forward_range<D<True>>`

## ◆ empty() [4/4]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr bool ranges::view_interface< Derived, Cardinality >::empty | ( |  | ) |
| constexpr noexcept

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

Precondition
  requires `True && (Cardinality < 0) && (Cardinality != infinite) && (!forward_range<D<True>>) && sized_range<D<True>>`

## ◆ front() [1/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> > ranges::view_interface< Derived, Cardinality >::front | ( |  | ) |
| constexpr

Access the first element in a range:

Precondition
  requires `True && forward_range<D<True>>`

## ◆ front() [2/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> const> ranges::view_interface< Derived, Cardinality >::front | ( |  | ) | 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 `True && forward_range<D<True> const>`

## ◆ operator bool() [1/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr ranges::view_interface< Derived, Cardinality >::operator bool | ( |  | ) | const
| explicit constexpr noexcept

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

Precondition
  requires `True && detail::can_empty_<D<True> const>` // clang-format off

## ◆ operator bool() [2/2]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr ranges::view_interface< Derived, Cardinality >::operator bool | ( |  | ) |
| explicit constexpr noexcept

Precondition
  requires `True && detail::can_empty_<D<True>>` // clang-format off

## ◆ operator[]() [1/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< detail::from_end_of_t< D< True >>, detail::from_end_of_t< D< True >>> | offs | ) | &
| 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 `True && (forward_range<D<True> &> || (input_range<D<True> &> && sized_range<D<True> &>))` //

## ◆ operator[]() [2/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< detail::from_end_of_t< D< True >>, detail::from_end_of_t< D< True >>> | offs | ) | &&
| 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 `True && (forward_range<D<True>> || (input_range<D<True>> && sized_range<D<True>>))` //

## ◆ operator[]() [3/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< detail::from_end_of_t< D< True >>, detail::from_end_of_t< D< True >>> | offs | ) | 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 `True && (forward_range<D<True> const &> || (input_range<D<True> const &> && sized_range<D<True> const &>))` //

## ◆ operator[]() [4/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< detail::from_end_of_t< D< True >>, end_fn > | offs | ) | &
| 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 `True && (forward_range<D<True> &> || (input_range<D<True> &> && sized_range<D<True> &>))` //

## ◆ operator[]() [5/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< detail::from_end_of_t< D< True >>, end_fn > | offs | ) | &&
| 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 `True && (forward_range<D<True>> || (input_range<D<True>> && sized_range<D<True>>))` //

## ◆ operator[]() [6/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< detail::from_end_of_t< D< True >>, end_fn > | offs | ) | 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 `True && (forward_range<D<True> const &> || (input_range<D<True> const &> && sized_range<D<True> const &>))` //

## ◆ operator[]() [7/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> | offs | ) | &
| 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 `True && input_range<D<True> &> && sized_range<D<True> &>`

## ◆ operator[]() [8/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> | offs | ) | &&
| 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 `True && input_range<D<True>> && sized_range<D<True>>`

## ◆ operator[]() [9/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> | offs | ) | 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 `True && input_range<D<True> const &> && sized_range<D<True> const &>`

## ◆ operator[]() [10/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>, end_fn > | offs | ) | &
| 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 `True && input_range<D<True> &>`

## ◆ operator[]() [11/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>, end_fn > | offs | ) | &&
| 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 `True && input_range<D<True>>`

## ◆ operator[]() [12/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>, end_fn > | offs | ) | 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 `True && input_range<D<True> const &>`

## ◆ operator[]() [13/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>> | offs | ) | &
| constexpr

Python-ic slicing:

Precondition
  requires `True && input_range<D<True> &>`

## ◆ operator[]() [14/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>> | offs | ) | &&
| 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 `True && input_range<D<True>>`

## ◆ operator[]() [15/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true, typename Slice = views::slice_fn>

constexpr auto ranges::view_interface< Derived, Cardinality >::operator[] | ( | detail::slice_bounds< range_difference_t< D< True >>> | offs | ) | 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 `True && input_range<D<True> const &>`

## ◆ operator[]() [16/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> > ranges::view_interface< Derived, Cardinality >::operator[] | ( | range_difference_t< D< True >> | n | ) |
| constexpr

Simple indexing:

Precondition
  requires `True && random_access_range<D<True>>`

## ◆ operator[]() [17/17]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr range_reference_t<D<True> const> ranges::view_interface< Derived, Cardinality >::operator[] | ( | range_difference_t< D< True >> | n | ) | 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 `True && random_access_range<D<True> const>`

## ◆ size() [1/3]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr detail::iter_size_t<iterator_t<D<True> > > ranges::view_interface< Derived, Cardinality >::size | ( |  | ) |
| constexpr

If `sized_sentinel_for<sentinel_t<Derived>, iterator_t<Derived>>` is satisfied, and if `Derived` is a `forward_range`, then return `end - begin` cast to an unsigned integer.

Precondition
  requires `True && (Cardinality < 0) && sized_sentinel_for<sentinel_t<D<True>>, iterator_t<D<True>>> && forward_range<D<True>>`

## ◆ size() [2/3]

template<typename Derived , cardinality Cardinality>
template<bool True = true>

constexpr detail::iter_size_t<iterator_t<D<True> > > ranges::view_interface< Derived, Cardinality >::size | ( |  | ) | 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 `True && (Cardinality < 0) && sized_sentinel_for<sentinel_t<D<True> const>, iterator_t<D<True> const>> && forward_range<D<True> const>`

## ◆ size() [3/3]

template<typename Derived , cardinality Cardinality>
template<bool True = true, int = 42>

static constexpr std::size_t ranges::view_interface< Derived, Cardinality >::size | ( |  | ) |
| static constexpr noexcept

If the size of the range is known at compile-time and finite, return it.

Precondition
  requires `True && (Cardinality >= 0)` //