template<typename T>
py::Range struct

Range.

The code snippet defines a struct template called Range that represents a range of values. It has two template parameters, T which represents the type of the values in the range.

Public types

using iterator = RangeIterator<T>
using value_type = T
using key_type = T

Public functions

auto begin() const -> iterator -> constexpr auto
begin
auto end() const -> iterator -> constexpr auto
end
auto empty() const -> bool -> constexpr auto
empty
auto size() const -> size_t -> constexpr auto
size
auto operator[](size_t n) const -> T -> constexpr auto
auto contains(T n) const -> bool -> constexpr auto

Public variables

T start
T stop

Function documentation

template<typename T _1>
constexpr auto py::Range<_1>::begin() const -> iterator

begin

Returns iterator

The begin() function is a member function of the Range struct template. It returns an iterator pointing to the beginning of the range. In this case, it creates a RangeIterator object with the start value of the range and returns it.

template<typename T _1>
constexpr auto py::Range<_1>::end() const -> iterator

end

Returns iterator

The end() function is a member function of the Range struct template. It returns an iterator pointing to the end of the range. In this case, it creates a RangeIterator object with the stop value of the range and returns it. This iterator represents the position one past the last element in the range.

template<typename T _1>
constexpr auto py::Range<_1>::empty() const -> bool

empty

Returns true

The empty() function is a member function of the Range struct template. It checks if the range is empty, meaning if the start and stop values are equal.

template<typename T _1>
constexpr auto py::Range<_1>::size() const -> size_t

size

Returns size_t

The size() function is a member function of the Range struct template. It calculates and returns the size of the range, which is the number of elements in the range.

template<typename T _1>
constexpr auto py::Range<_1>::operator[](size_t n) const -> T

Parameters
in
Returns T

template<typename T _1>
constexpr auto py::Range<_1>::contains(T n) const -> bool

Parameters
in
Returns true