#include <py2cpp/range.hpp>
Range struct
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
Function documentation
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.
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.