Py2Cpp 1.6.3; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
py::RangeIterator< T > Struct Template Reference

Iterator for range-based sequences. More...

#include <range.hpp>

Public Types

using iterator_category = std::input_iterator_tag
 
using difference_type = std::ptrdiff_t
 
using value_type = T
 
using pointer = const T *
 
using reference = const T &
 
using const_reference = const T &
 
using key_type = T
 

Public Member Functions

constexpr auto operator!= (const RangeIterator &other) const -> bool
 Not equal to.
 
constexpr auto operator== (const RangeIterator &other) const -> bool
 Equal to operator.
 
CONSTEXPR14 auto operator* () const -> const_reference
 
CONSTEXPR14 auto operator++ () -> RangeIterator &
 Pre-increment operator.
 
CONSTEXPR14 auto operator++ (int) -> RangeIterator
 Post-increment operator.
 

Public Attributes

i
 

Detailed Description

template<typename T>
struct py::RangeIterator< T >

Iterator for range-based sequences.

Provides iterator functionality for generating sequential values, similar to Python's range() function.

Template Parameters
TThe value type generated by the iterator

Member Typedef Documentation

◆ const_reference

template<typename T >
using py::RangeIterator< T >::const_reference = const T&

◆ difference_type

template<typename T >
using py::RangeIterator< T >::difference_type = std::ptrdiff_t

◆ iterator_category

template<typename T >
using py::RangeIterator< T >::iterator_category = std::input_iterator_tag

◆ key_type

template<typename T >
using py::RangeIterator< T >::key_type = T

◆ pointer

template<typename T >
using py::RangeIterator< T >::pointer = const T*

◆ reference

template<typename T >
using py::RangeIterator< T >::reference = const T&

◆ value_type

template<typename T >
using py::RangeIterator< T >::value_type = T

Member Function Documentation

◆ operator!=()

template<typename T >
constexpr auto py::RangeIterator< T >::operator!= ( const RangeIterator< T > &  other) const -> bool
inlineconstexpr

Not equal to.

The operator!= function checks if the current iterator is not equal to another iterator.

Parameters
[in]otherother is a RangeIterator object that represents another iterator.
Returns
The operator!= function returns a boolean value indicating whether the two iterators are not equal.

◆ operator*()

template<typename T >
CONSTEXPR14 auto py::RangeIterator< T >::operator* ( ) const -> const_reference
inline

The operator*() function is used to dereference the iterator and return the value it points to.

Returns
The operator*() function is returning a const_reference, which is the value that the iterator points to.

◆ operator++() [1/2]

template<typename T >
CONSTEXPR14 auto py::RangeIterator< T >::operator++ ( ) -> RangeIterator&
inline

Pre-increment operator.

Increments the iterator to the next element in the range.

Returns
RangeIterator& Reference to this iterator

◆ operator++() [2/2]

template<typename T >
CONSTEXPR14 auto py::RangeIterator< T >::operator++ ( int  ) -> RangeIterator
inline

Post-increment operator.

Increments the iterator to the next element in the range, returning a copy of the iterator before the increment.

Returns
RangeIterator Copy of this iterator before increment

◆ operator==()

template<typename T >
constexpr auto py::RangeIterator< T >::operator== ( const RangeIterator< T > &  other) const -> bool
inlineconstexpr

Equal to operator.

The operator== function checks if the current iterator is equal to another iterator.

Parameters
[in]otherother 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.

Member Data Documentation

◆ i

template<typename T >
T py::RangeIterator< T >::i

The documentation for this struct was generated from the following file: