|
CeresEngine 0.2.0
A game development framework
|
An iterator type that keeps an index count of the current item. More...
#include <CeresEngine/Foundation/Iterator/Enumerate.hpp>
Public Types | |
| using | iterator_category = typename std::iterator_traits< Iterator >::iterator_category |
| using | value_type = typename std::iterator_traits< Iterator >::value_type |
| using | difference_type = typename std::iterator_traits< Iterator >::difference_type |
| using | pointer = typename std::iterator_traits< Iterator >::pointer |
| using | reference = typename std::iterator_traits< Iterator >::reference |
Public Member Functions | |
| EnumerateIterator (Index index, Iterator &&iterator) | |
Creates a new enumerate iterator at the given index positioned at the given it iterator. | |
| EnumerateIterator & | operator++ () |
| Increments the iterator. Will also increment the index position. | |
| EnumerateIterator | operator++ (int) |
| Increments the iterator. Will also increment the index position. | |
| EnumerateIterator & | operator+ (difference_type offset) |
Advances the iterator by the given offset. | |
| EnumerateIterator & | operator-- () |
| Decrements the iterator. Will also decrement the index position. | |
| EnumerateIterator | operator-- (int) |
| Decrements the iterator. Will also decrement the index position. | |
| EnumerateIterator & | operator- (difference_type offset) |
Recedes the iterator by the given offset. | |
| auto | operator* () const noexcept |
| Dereferences the iterator and obtain it's value. | |
| auto * | operator-> () const noexcept |
| Dereferences the iterator and obtain it's value. | |
| bool | operator== (const EnumerateIterator &other) const |
| bool | operator!= (const EnumerateIterator &other) const |
| bool | operator> (const EnumerateIterator &other) const |
| bool | operator>= (const EnumerateIterator &other) const |
| bool | operator< (const EnumerateIterator &other) const |
| bool | operator<= (const EnumerateIterator &other) const |
Private Attributes | |
| Index | mIndex = 0 |
| The current iteration index. | |
| Iterator | mIterator |
| The current iterator position. | |
An iterator type that keeps an index count of the current item.
Useful when you need both the value and the index of the value when doing for-range loop.
| Iterator | The underlying iterator type. |
| Index | The type of the counter index. |
| using CeresEngine::EnumerateIterator< Iterator, Index >::difference_type = typename std::iterator_traits<Iterator>::difference_type |
| using CeresEngine::EnumerateIterator< Iterator, Index >::iterator_category = typename std::iterator_traits<Iterator>::iterator_category |
| using CeresEngine::EnumerateIterator< Iterator, Index >::pointer = typename std::iterator_traits<Iterator>::pointer |
| using CeresEngine::EnumerateIterator< Iterator, Index >::reference = typename std::iterator_traits<Iterator>::reference |
| using CeresEngine::EnumerateIterator< Iterator, Index >::value_type = typename std::iterator_traits<Iterator>::value_type |
|
inline |
Creates a new enumerate iterator at the given index positioned at the given it iterator.
|
inline |
|
inlinenoexcept |
Dereferences the iterator and obtain it's value.
|
inline |
Advances the iterator by the given offset.
|
inline |
Increments the iterator. Will also increment the index position.
|
inline |
Increments the iterator. Will also increment the index position.
|
inline |
Recedes the iterator by the given offset.
|
inline |
Decrements the iterator. Will also decrement the index position.
|
inline |
Decrements the iterator. Will also decrement the index position.
|
inlinenoexcept |
Dereferences the iterator and obtain it's value.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
The current iteration index.
|
private |
The current iterator position.