emlabcpp
modern opinionated embedded C++ library
emlabcpp::iterators::numeric_iterator< T > Class Template Reference

numeric iterator - iterator over numbers (which are calculated on the fly) Value of type T is stored internally and incremented as the iterator is moved forward/backward More...

#include <numeric.h>

+ Inheritance diagram for emlabcpp::iterators::numeric_iterator< T >:
+ Collaboration diagram for emlabcpp::iterators::numeric_iterator< T >:

Public Member Functions

constexpr numeric_iterator (T val)
 Initializes iterator to value val. More...
 
constexpr T & operator* ()
 
constexpr T const & operator* () const
 
constexpr numeric_iteratoroperator+= (std::ptrdiff_t offset)
 
constexpr numeric_iteratoroperator-= (std::ptrdiff_t offset)
 
constexpr auto operator<=> (numeric_iterator< T > const &other) const
 
constexpr bool operator== (numeric_iterator< T > const &other) const
 
constexpr std::ptrdiff_t operator- (numeric_iterator const &other) const
 

Detailed Description

template<typename T>
class emlabcpp::iterators::numeric_iterator< T >

numeric iterator - iterator over numbers (which are calculated on the fly) Value of type T is stored internally and incremented as the iterator is moved forward/backward

T has to be any type for which operators +=, <, ++ and conversion to std::ptrdiff_t are defined.

Constructor & Destructor Documentation

◆ numeric_iterator()

template<typename T >
constexpr emlabcpp::iterators::numeric_iterator< T >::numeric_iterator ( val)
inlineexplicitconstexpr

Initializes iterator to value val.

Member Function Documentation

◆ operator*() [1/2]

template<typename T >
constexpr T& emlabcpp::iterators::numeric_iterator< T >::operator* ( )
inlineconstexpr

◆ operator*() [2/2]

template<typename T >
constexpr T const& emlabcpp::iterators::numeric_iterator< T >::operator* ( ) const
inlineconstexpr

◆ operator+=()

template<typename T >
constexpr numeric_iterator& emlabcpp::iterators::numeric_iterator< T >::operator+= ( std::ptrdiff_t  offset)
inlineconstexpr

◆ operator-()

template<typename T >
constexpr std::ptrdiff_t emlabcpp::iterators::numeric_iterator< T >::operator- ( numeric_iterator< T > const &  other) const
inlineconstexpr

◆ operator-=()

template<typename T >
constexpr numeric_iterator& emlabcpp::iterators::numeric_iterator< T >::operator-= ( std::ptrdiff_t  offset)
inlineconstexpr

◆ operator<=>()

template<typename T >
constexpr auto emlabcpp::iterators::numeric_iterator< T >::operator<=> ( numeric_iterator< T > const &  other) const
inlineconstexpr

◆ operator==()

template<typename T >
constexpr bool emlabcpp::iterators::numeric_iterator< T >::operator== ( numeric_iterator< T > const &  other) const
inlineconstexpr

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