#include <py2cpp/range.hpp>
template<typename T>
RangeIterator struct
Template parameters | |
---|---|
T |
Public types
- using iterator_category = std::output_iterator_tag
- using difference_type = std::ptrdiff_t
- using value_type = T
- using pointer = T*
- using reference = T&
- using const_reference = const T&
- using key_type = T
Public functions
- auto operator!=(const RangeIterator& other) const -> bool -> auto constexpr
- Not equal to.
- auto operator==(const RangeIterator& other) const -> bool -> auto constexpr
- Equal to operator.
- auto operator*() const -> const_reference -> CONSTEXPR14 auto
- auto operator*() -> reference -> CONSTEXPR14 auto
- auto operator++() -> RangeIterator & -> CONSTEXPR14 auto
- The code snippet you provided is defining the pre-increment operator (
operator++()
) for theRangeIterator
struct. This operator is used to increment the iterator to the next element in the range. - auto operator++(int) -> RangeIterator -> CONSTEXPR14 auto
- The code snippet you provided is defining the post-increment operator (
operator++(int)
) for theRangeIterator
struct. This operator is used to increment the iterator to the next element in the range, but it returns a copy of the iterator before the increment.
Public variables
- T i
Function documentation
template<typename T>
auto py:: RangeIterator<T>:: operator!=(const RangeIterator& other) const -> bool constexpr
Not equal to.
Parameters | |
---|---|
other in | other is a RangeIterator object that represents another iterator. |
Returns | The operator!= function returns a boolean value indicating whether the two iterators are not equal. |
The operator!=
function checks if the current iterator is not equal to another iterator.
template<typename T>
auto py:: RangeIterator<T>:: operator==(const RangeIterator& other) const -> bool constexpr
Equal to operator.
Parameters | |
---|---|
other in | other is a RangeIterator object that is being compared to the current iterator. |
Returns | The operator== function returns a boolean value indicating whether the two iterators are equal. |
The operator==
function checks if the current iterator is equal to another iterator.
template<typename T>
CONSTEXPR14 auto py:: RangeIterator<T>:: operator*() const -> const_reference
Returns | The operator*() function is returning a const_reference , which is the value that the iterator points to. |
---|
The operator*()
function is used to dereference the iterator and return the value it points to.
template<typename T>
CONSTEXPR14 auto py:: RangeIterator<T>:: operator*() -> reference
Returns | The operator*() function is returning a reference to the value that the iterator points to. |
---|
The operator*()
function is used to dereference the iterator and return the value it points to.
template<typename T>
CONSTEXPR14 auto py:: RangeIterator<T>:: operator++() -> RangeIterator &
The code snippet you provided is defining the pre-increment operator (operator++()
) for the RangeIterator
struct. This operator is used to increment the iterator to the next element in the range.
Returns | RangeIterator& |
---|
template<typename T>
CONSTEXPR14 auto py:: RangeIterator<T>:: operator++(int) -> RangeIterator
The code snippet you provided is defining the post-increment operator (operator++(int)
) for the RangeIterator
struct. This operator is used to increment the iterator to the next element in the range, but it returns a copy of the iterator before the increment.
Returns | RangeIterator |
---|