|
Blaze 3.9
|
Implementation of an iterator for (extended) initializer lists. More...
#include <InitializerIterator.h>
Public Types | |
| using | IteratorCategory = std::random_access_iterator_tag |
| The iterator category. | |
| using | ValueType = Type |
| Type of the underlying elements. | |
| using | PointerType = const Type* |
| Pointer return type. | |
| using | ReferenceType = const Type& |
| Reference return type. | |
| using | DifferenceType = ptrdiff_t |
| Difference between two iterators. | |
| using | iterator_category = IteratorCategory |
| The iterator category. | |
| using | value_type = ValueType |
| Type of the underlying elements. | |
| using | pointer = PointerType |
| Pointer return type. | |
| using | reference = ReferenceType |
| Reference return type. | |
| using | difference_type = DifferenceType |
| Difference between two iterators. | |
Public Member Functions | |
Constructors | |
| InitializerIterator () noexcept | |
| Default constructor for the InitializerIterator class. | |
| InitializerIterator (size_t index, initializer_list< Type > list) noexcept | |
| Constructor for the InitializerIterator class. | |
| InitializerIterator (const InitializerIterator &)=default | |
Destructor | |
Assignment operators | |
| InitializerIterator & | operator+= (ptrdiff_t inc) noexcept |
| Addition assignment operator. | |
| InitializerIterator & | operator-= (ptrdiff_t dec) noexcept |
| Subtraction assignment operator. | |
| InitializerIterator & | operator= (const InitializerIterator &)=default |
Increment/decrement operators | |
| InitializerIterator & | operator++ () noexcept |
| Pre-increment operator. | |
| const InitializerIterator | operator++ (int) noexcept |
| Post-increment operator. | |
| InitializerIterator & | operator-- () noexcept |
| Pre-decrement operator. | |
| const InitializerIterator | operator-- (int) noexcept |
| Post-decrement operator. | |
Access operators | |
| ReferenceType | operator[] (size_t index) const noexcept |
| Direct access to the underlying elements. | |
| ReferenceType | operator* () const noexcept |
| Direct access to the element at the current iterator position. | |
| PointerType | operator-> () const noexcept |
| Direct access to the element at the current iterator position. | |
Utility functions | |
| size_t | index_ |
| Current index of the iterator within the initializer list. | |
| initializer_list< Type > | list_ |
| The initializer list to be traversed. | |
| static const Type | zero_ |
| Neutral element for accesses to zero elements. | |
| size_t | index () const noexcept |
| Low-level access to the underlying index member of the iterator. | |
| initializer_list< Type > | list () const noexcept |
| Low-level access to the underlying list member of the iterator. | |
Implementation of an iterator for (extended) initializer lists.
The InitializerIterator represents a generic random-access iterator for (extended) initializer lists. It can be used for initializer lists representing dense vectors and specific rows of dense matrices.
|
inlineexplicitnoexcept |
Constructor for the InitializerIterator class.
| index | The initial index of the iterator within the initializer list. |
| list | The initializer list to be traversed. |
|
inlinenoexcept |
Low-level access to the underlying index member of the iterator.
|
inlinenoexcept |
Low-level access to the underlying list member of the iterator.
|
inlinenoexcept |
Direct access to the element at the current iterator position.
|
inlinenoexcept |
Pre-increment operator.
|
inlinenoexcept |
Post-increment operator.
|
inlinenoexcept |
Addition assignment operator.
| inc | The increment of the iterator. |
|
inlinenoexcept |
Pre-decrement operator.
|
inlinenoexcept |
Post-decrement operator.
|
inlinenoexcept |
Subtraction assignment operator.
| dec | The decrement of the iterator. |
|
inlinenoexcept |
Direct access to the element at the current iterator position.
|
inlinenoexcept |
Direct access to the underlying elements.
| index | Access index. |