Blaze 3.9
Loading...
Searching...
No Matches
blaze::InitializerIterator< Type > Class Template Reference

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.

Detailed Description

template<typename Type>
class blaze::InitializerIterator< Type >

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.

Constructor & Destructor Documentation

◆ InitializerIterator()

template<typename Type>
blaze::InitializerIterator< Type >::InitializerIterator ( size_t index,
initializer_list< Type > list )
inlineexplicitnoexcept

Constructor for the InitializerIterator class.

Parameters
indexThe initial index of the iterator within the initializer list.
listThe initializer list to be traversed.

Member Function Documentation

◆ index()

template<typename Type>
size_t blaze::InitializerIterator< Type >::index ( ) const
inlinenoexcept

Low-level access to the underlying index member of the iterator.

Returns
Index of the current iterator position.

◆ list()

template<typename Type>
initializer_list< Type > blaze::InitializerIterator< Type >::list ( ) const
inlinenoexcept

Low-level access to the underlying list member of the iterator.

Returns
The underlying initializer list.

◆ operator*()

template<typename Type>
InitializerIterator< Type >::ReferenceType blaze::InitializerIterator< Type >::operator* ( ) const
inlinenoexcept

Direct access to the element at the current iterator position.

Returns
The resulting value.

◆ operator++() [1/2]

template<typename Type>
InitializerIterator< Type > & blaze::InitializerIterator< Type >::operator++ ( )
inlinenoexcept

Pre-increment operator.

Returns
Reference to the incremented iterator.

◆ operator++() [2/2]

template<typename Type>
const InitializerIterator< Type > blaze::InitializerIterator< Type >::operator++ ( int )
inlinenoexcept

Post-increment operator.

Returns
The previous position of the iterator.

◆ operator+=()

template<typename Type>
InitializerIterator< Type > & blaze::InitializerIterator< Type >::operator+= ( ptrdiff_t inc)
inlinenoexcept

Addition assignment operator.

Parameters
incThe increment of the iterator.
Returns
The incremented iterator.

◆ operator--() [1/2]

template<typename Type>
InitializerIterator< Type > & blaze::InitializerIterator< Type >::operator-- ( )
inlinenoexcept

Pre-decrement operator.

Returns
Reference to the decremented iterator.

◆ operator--() [2/2]

template<typename Type>
const InitializerIterator< Type > blaze::InitializerIterator< Type >::operator-- ( int )
inlinenoexcept

Post-decrement operator.

Returns
The previous position of the iterator.

◆ operator-=()

template<typename Type>
InitializerIterator< Type > & blaze::InitializerIterator< Type >::operator-= ( ptrdiff_t dec)
inlinenoexcept

Subtraction assignment operator.

Parameters
decThe decrement of the iterator.
Returns
The decremented iterator.

◆ operator->()

template<typename Type>
InitializerIterator< Type >::PointerType blaze::InitializerIterator< Type >::operator-> ( ) const
inlinenoexcept

Direct access to the element at the current iterator position.

Returns
Pointer to the element at the current iterator position.

◆ operator[]()

template<typename Type>
InitializerIterator< Type >::ReferenceType blaze::InitializerIterator< Type >::operator[] ( size_t index) const
inlinenoexcept

Direct access to the underlying elements.

Parameters
indexAccess index.
Returns
Reference to the accessed value.

The documentation for this class was generated from the following file: