![]() |
Blaze
3.6
|
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. 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. More... | |
InitializerIterator (const InitializerIterator &)=default | |
Destructor | |
~InitializerIterator ()=default | |
Assignment operators | |
InitializerIterator & | operator+= (ptrdiff_t inc) noexcept |
Addition assignment operator. More... | |
InitializerIterator & | operator-= (ptrdiff_t dec) noexcept |
Subtraction assignment operator. More... | |
InitializerIterator & | operator= (const InitializerIterator &)=default |
Increment/decrement operators | |
InitializerIterator & | operator++ () noexcept |
Pre-increment operator. More... | |
const InitializerIterator | operator++ (int) noexcept |
Post-increment operator. More... | |
InitializerIterator & | operator-- () noexcept |
Pre-decrement operator. More... | |
const InitializerIterator | operator-- (int) noexcept |
Post-decrement operator. More... | |
Access operators | |
ReferenceType | operator[] (size_t index) const noexcept |
Direct access to the underlying elements. More... | |
ReferenceType | operator * () const noexcept |
Direct access to the element at the current iterator position. More... | |
PointerType | operator-> () const noexcept |
Direct access to the element at the current iterator position. More... | |
Utility functions | |
size_t | index () const noexcept |
Low-level access to the underlying index member of the iterator. More... | |
initializer_list< Type > | list () const noexcept |
Low-level access to the underlying list member of the iterator. More... | |
Private Attributes | |
size_t | index_ |
Current index of the iterator within the initializer list. | |
initializer_list< Type > | list_ |
The initializer list to be traversed. | |
Static Private Attributes | |
static const Type | zero_ {} |
Neutral element for accesses to zero elements. | |
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. |