QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Iterator advancing in constant steps. More...
#include <steppingiterator.hpp>
Public Types | |
using | iterator_category = typename std::iterator_traits< Iterator >::iterator_category |
using | difference_type = typename std::iterator_traits< Iterator >::difference_type |
using | value_type = typename std::iterator_traits< Iterator >::value_type |
using | pointer = typename std::iterator_traits< Iterator >::pointer |
using | reference = typename std::iterator_traits< Iterator >::reference |
Public Member Functions | |
step_iterator ()=default | |
step_iterator (const Iterator &base, Size step) | |
template<class OtherIterator > | |
step_iterator (const step_iterator< OtherIterator > &i, std::enable_if_t< std::is_convertible< OtherIterator, Iterator >::value > *=nullptr) | |
Size | step () const |
Iterator | base () const |
void | increment () |
void | decrement () |
void | advance (typename std::iterator_traits< Iterator >::difference_type n) |
std::iterator_traits< Iterator >::difference_type | distance_to (const step_iterator &i) const |
step_iterator & | operator= (const step_iterator &other) |
step_iterator & | operator++ () |
step_iterator | operator++ (int) |
reference | operator* () const |
step_iterator & | operator-- () |
step_iterator | operator-- (int) |
step_iterator & | operator+= (Size n) |
step_iterator & | operator-= (Size n) |
reference | operator[] (Size n) const |
Private Attributes | |
Iterator | base_ {} |
BigInteger | step_ {} |
Friends | |
step_iterator | operator+ (const step_iterator &i, Size n) |
step_iterator | operator+ (Size n, const step_iterator &i) |
step_iterator | operator- (const step_iterator &i, Size n) |
difference_type | operator- (const step_iterator &lhs, const step_iterator &rhs) |
bool | operator== (const step_iterator &lhs, const step_iterator &rhs) |
bool | operator!= (const step_iterator &lhs, const step_iterator &rhs) |
bool | operator< (const step_iterator &lhs, const step_iterator &rhs) |
bool | operator> (const step_iterator &lhs, const step_iterator &rhs) |
bool | operator<= (const step_iterator &lhs, const step_iterator &rhs) |
bool | operator>= (const step_iterator &lhs, const step_iterator &rhs) |
Related Functions | |
(Note that these are not member functions.) | |
template<class Iterator > | |
step_iterator< Iterator > | make_step_iterator (Iterator it, Size step) |
helper function to create step iterators More... | |
Iterator advancing in constant steps.
This iterator advances an underlying random-access iterator in steps of \( n \) positions, where \( n \) is a positive integer given upon construction.
Definition at line 44 of file steppingiterator.hpp.
using iterator_category = typename std::iterator_traits<Iterator>::iterator_category |
Definition at line 51 of file steppingiterator.hpp.
using difference_type = typename std::iterator_traits<Iterator>::difference_type |
Definition at line 52 of file steppingiterator.hpp.
using value_type = typename std::iterator_traits<Iterator>::value_type |
Definition at line 53 of file steppingiterator.hpp.
using pointer = typename std::iterator_traits<Iterator>::pointer |
Definition at line 54 of file steppingiterator.hpp.
using reference = typename std::iterator_traits<Iterator>::reference |
Definition at line 55 of file steppingiterator.hpp.
|
default |
|
explicit |
Definition at line 59 of file steppingiterator.hpp.
step_iterator | ( | const step_iterator< OtherIterator > & | i, |
std::enable_if_t< std::is_convertible< OtherIterator, Iterator >::value > * | = nullptr |
||
) |
Definition at line 63 of file steppingiterator.hpp.
Size step | ( | ) | const |
Definition at line 69 of file steppingiterator.hpp.
Iterator base | ( | ) | const |
Definition at line 75 of file steppingiterator.hpp.
void increment | ( | ) |
Definition at line 81 of file steppingiterator.hpp.
void decrement | ( | ) |
Definition at line 89 of file steppingiterator.hpp.
void advance | ( | typename std::iterator_traits< Iterator >::difference_type | n | ) |
Definition at line 97 of file steppingiterator.hpp.
std::iterator_traits< Iterator >::difference_type distance_to | ( | const step_iterator< Iterator > & | i | ) | const |
Definition at line 106 of file steppingiterator.hpp.
step_iterator & operator= | ( | const step_iterator< Iterator > & | other | ) |
Definition at line 110 of file steppingiterator.hpp.
step_iterator & operator++ | ( | ) |
Definition at line 116 of file steppingiterator.hpp.
step_iterator operator++ | ( | int | ) |
Definition at line 121 of file steppingiterator.hpp.
reference operator* | ( | ) | const |
Definition at line 127 of file steppingiterator.hpp.
step_iterator & operator-- | ( | ) |
Definition at line 131 of file steppingiterator.hpp.
step_iterator operator-- | ( | int | ) |
Definition at line 136 of file steppingiterator.hpp.
step_iterator & operator+= | ( | Size | n | ) |
Definition at line 142 of file steppingiterator.hpp.
step_iterator & operator-= | ( | Size | n | ) |
Definition at line 147 of file steppingiterator.hpp.
Definition at line 152 of file steppingiterator.hpp.
|
friend |
Definition at line 156 of file steppingiterator.hpp.
|
friend |
Definition at line 160 of file steppingiterator.hpp.
|
friend |
Definition at line 164 of file steppingiterator.hpp.
|
friend |
Definition at line 168 of file steppingiterator.hpp.
|
friend |
Definition at line 175 of file steppingiterator.hpp.
|
friend |
Definition at line 179 of file steppingiterator.hpp.
|
friend |
Definition at line 183 of file steppingiterator.hpp.
|
friend |
Definition at line 190 of file steppingiterator.hpp.
|
friend |
Definition at line 197 of file steppingiterator.hpp.
|
friend |
Definition at line 204 of file steppingiterator.hpp.
|
related |
helper function to create step iterators
Definition at line 215 of file steppingiterator.hpp.
|
private |
Definition at line 46 of file steppingiterator.hpp.
|
private |
Definition at line 48 of file steppingiterator.hpp.