|
MCKL
Monte Carlo Kernel Library
|
Iterator adapter which increment the base iterator in multiple steps. More...
#include <mckl/core/iterator.hpp>
Public Types | |
| using | difference_type = std::make_signed_t< typename std::iterator_traits< Base >::difference_type > |
| using | iterator_category = typename std::iterator_traits< Base >::iterator_category |
| using | pointer = typename std::iterator_traits< Base >::pointer |
| using | reference = typename std::iterator_traits< Base >::reference |
| using | value_type = typename std::iterator_traits< Base >::value_type |
Public Member Functions | |
| StepIterator () noexcept(std::is_nothrow_default_constructible< Base >::value) | |
| Default constructor. More... | |
| StepIterator (Base base, difference_type step=1) noexcept(std::is_nothrow_copy_constructible< Base >::value) | |
| Convert from a base iterator. More... | |
| template<typename T > | |
| StepIterator (const StepIterator< T > &other) noexcept(std::is_nothrow_copy_constructible< Base >::value) | |
| Convert from compatible StepIterator. More... | |
| Base | base () const |
| Return the underlying base iterator. More... | |
| reference | operator* () const |
| Dereference the base iterator. More... | |
| Base | operator-> () const |
| Member selection through the base iterator. More... | |
| template<typename IntType > | |
| reference | operator[] (IntType n) const |
Equivalent to *((*this) + n) More... | |
| difference_type | step () const |
| Return the increment step size. More... | |
Friends | |
| bool | operator!= (const StepIterator &iter1, const StepIterator &iter2) |
| Compare inequality. More... | |
| template<typename IntType > | |
| StepIterator | operator+ (const StepIterator &iter, IntType n) |
Addition with integer: advance the base iterator by a distance of n * iter.step() More... | |
| template<typename IntType > | |
| StepIterator | operator+ (IntType n, const StepIterator &iter) |
| Addition with integer. More... | |
| StepIterator & | operator++ (StepIterator &iter) |
Prefix increment: advance the base iterator by a distance of iter.step() More... | |
| StepIterator | operator++ (StepIterator &iter, int) |
| Postfix increment. More... | |
| template<typename IntType > | |
| StepIterator & | operator+= (StepIterator &iter, IntType n) |
| Compound addition with integer. More... | |
| template<typename IntType > | |
| StepIterator | operator- (const StepIterator &iter, IntType n) |
Subtraction with integer: advance the base iterator by a distance -n * iter.step() More... | |
| difference_type | operator- (const StepIterator &iter1, const StepIterator &iter2) |
| Difference between two iterators. More... | |
| StepIterator & | operator-- (StepIterator &iter) |
Prefix decrement: advance the base iterator by a distance of -iter.step() More... | |
| StepIterator | operator-- (StepIterator &iter, int) |
| Postfix decrement. More... | |
| template<typename IntType > | |
| StepIterator & | operator-= (StepIterator &iter, IntType n) |
| Compound subtraction with integer. More... | |
| bool | operator< (const StepIterator &iter1, const StepIterator &iter2) |
| Compare less than relation. More... | |
| bool | operator<= (const StepIterator &iter1, const StepIterator &iter2) |
| Compare less than relation or equality. More... | |
| bool | operator== (const StepIterator &iter1, const StepIterator &iter2) |
| Compare equality. More... | |
| bool | operator> (const StepIterator &iter1, const StepIterator &iter2) |
| Compare greater than relation. More... | |
| bool | operator>= (const StepIterator &iter1, const StepIterator &iter2) |
| Compare greater than relation or equality. More... | |
Iterator adapter which increment the base iterator in multiple steps.
| Base | An iterator type |
Definition at line 44 of file iterator.hpp.
| using mckl::StepIterator< Base >::difference_type = std::make_signed_t< typename std::iterator_traits<Base>::difference_type> |
Definition at line 48 of file iterator.hpp.
| using mckl::StepIterator< Base >::iterator_category = typename std::iterator_traits<Base>::iterator_category |
Definition at line 53 of file iterator.hpp.
| using mckl::StepIterator< Base >::pointer = typename std::iterator_traits<Base>::pointer |
Definition at line 50 of file iterator.hpp.
| using mckl::StepIterator< Base >::reference = typename std::iterator_traits<Base>::reference |
Definition at line 51 of file iterator.hpp.
| using mckl::StepIterator< Base >::value_type = typename std::iterator_traits<Base>::value_type |
Definition at line 49 of file iterator.hpp.
|
inlinenoexcept |
Default constructor.
Definition at line 56 of file iterator.hpp.
|
inlineexplicitnoexcept |
Convert from a base iterator.
| base | The base iterator |
| step | The step size. Each call of the increment/decrement operator of the newly constructed iterator will advance it by a distance equal to step. |
Base is copy constructible Definition at line 69 of file iterator.hpp.
|
inlinenoexcept |
Convert from compatible StepIterator.
Definition at line 79 of file iterator.hpp.
|
inline |
Return the underlying base iterator.
Definition at line 86 of file iterator.hpp.
|
inline |
Dereference the base iterator.
Definition at line 92 of file iterator.hpp.
|
inline |
Member selection through the base iterator.
Definition at line 95 of file iterator.hpp.
|
inline |
Equivalent to *((*this) + n)
Base is an input iterator Base is a bidirectional iterator if n * step() < 0 Definition at line 102 of file iterator.hpp.
|
inline |
Return the increment step size.
Definition at line 89 of file iterator.hpp.
|
friend |
Compare inequality.
Base is inequality comparable iter1.step() == iter2.step() Definition at line 124 of file iterator.hpp.
|
friend |
Addition with integer: advance the base iterator by a distance of n * iter.step()
Base is an input iterator Base is a bidirectional iterator if n * iter.step() < 0 Definition at line 241 of file iterator.hpp.
|
friend |
Addition with integer.
Base is an input iterator Base is a bidirectional iterator if n * iter.step() < 0 Definition at line 256 of file iterator.hpp.
|
friend |
Prefix increment: advance the base iterator by a distance of iter.step()
Base is an input iterator Base is a bidirectional iterator if iter.step() < 0 Definition at line 188 of file iterator.hpp.
|
friend |
Postfix increment.
Base is an input iterator Base is a bidirectional iterator if iter.step() < 0 Definition at line 201 of file iterator.hpp.
|
friend |
Compound addition with integer.
Base is an input iterator Base is a bidirectional iterator if n * iter.step() < 0 Definition at line 277 of file iterator.hpp.
|
friend |
Subtraction with integer: advance the base iterator by a distance -n * iter.step()
Base is an input iterator Base is a bidirectional iterator if n * iter.step() > 0 Definition at line 267 of file iterator.hpp.
|
friend |
Difference between two iterators.
Base is an input iterator iter1 is reachable by incrementing iter2 iter1.step() == iter2.step() Definition at line 297 of file iterator.hpp.
|
friend |
Prefix decrement: advance the base iterator by a distance of -iter.step()
Base is a input iterator Base is a bidirectional iterator if iter.step() > 0 Definition at line 214 of file iterator.hpp.
|
friend |
Postfix decrement.
Base is a input iterator Base is a bidirectional iterator if iter.step() > 0 Definition at line 227 of file iterator.hpp.
|
friend |
Compound subtraction with integer.
Base is an input iterator Base is a bidirectional iterator if n * iter.step() > 0 Definition at line 287 of file iterator.hpp.
|
friend |
Compare less than relation.
Base is less than comparable iter1.step() == iter2.step() Definition at line 137 of file iterator.hpp.
|
friend |
Compare less than relation or equality.
Base is less than or equality comparable iter1.step() == iter2.step() Definition at line 149 of file iterator.hpp.
|
friend |
Compare equality.
Base is equality comparable iter1.step() == iter2.step() Definition at line 111 of file iterator.hpp.
|
friend |
Compare greater than relation.
Base is greater than comparable iter1.step() == iter2.step() Definition at line 162 of file iterator.hpp.
|
friend |
Compare greater than relation or equality.
Base is greater than or equality comparable iter1.step() == iter2.step() Definition at line 174 of file iterator.hpp.
1.8.13