|
Py2Cpp 1.6.3; VERSION ${PROJECT_VERSION}
|
Python-like range implementation. More...
#include <range.hpp>
Public Types | |
| using | iterator = RangeIterator< T > |
| using | value_type = T |
| using | key_type = T |
Public Member Functions | |
| constexpr auto | begin () const -> iterator |
| Get iterator to the beginning of the range. | |
| constexpr auto | end () const -> iterator |
| Get iterator to the end of the range. | |
| constexpr auto | empty () const -> bool |
| Check if the range is empty. | |
| constexpr auto | size () const -> size_t |
| Get the size of the range. | |
| constexpr auto | operator[] (size_t n) const -> T |
| Get element at index. | |
| constexpr auto | contains (T n) const noexcept -> bool |
| Check if the range contains a value. | |
Public Attributes | |
| T | start |
| T | stop |
Python-like range implementation.
Represents a sequence of numbers from start to stop (exclusive), similar to Python's range() function.
| T | The numeric type for the range values |
| using py::Range< T >::iterator = RangeIterator<T> |
| using py::Range< T >::key_type = T |
| using py::Range< T >::value_type = T |
Get iterator to the beginning of the range.
Returns an iterator pointing to the start value of the range.
|
inlineconstexprnoexcept |
Check if the range contains a value.
| [in] | n | The value to check |
|
inlineconstexpr |
Check if the range is empty.
Returns true if the range has no elements (start equals stop).
Get iterator to the end of the range.
Returns an iterator pointing past the last element in the range.
|
inlineconstexpr |
Get element at index.
Returns the value at the specified index in the range.
| [in] | n | The index |
|
inlineconstexpr |
Get the size of the range.
Returns the number of elements in the range.
| T py::Range< T >::start |
| T py::Range< T >::stop |