Skip to content

ArrayImpl::IteratorImpl

#include <ncarray/array_impl.hh>
template<class VT>
class IteratorImpl

Defined in src/lib/ncarray/array_impl.hh:1752

An value-based iterator for traversing an array along the first dimension.

This iterator is in some respects atypical by standard C++ standards. However, it provides a simplified API for a common operation on multi-dimensional arrays, namely, iterating along an axis – in particular, it iterates the FIRST axis.

This iterator implementation generates sub-views by value on the fly. The ArrayImpl class is rather light-weight and the views are non-owning, so this strategy is appropriate. The complexity of managing a true pointer/reference based iterator for array’s with varying layouts of suboffsets (pointer axes) outweighs the benefits in reducing the subview construction by value cost.

Name Kind Owner
operator== friend Declared here
operator!= friend Declared here
IteratorImpl function Declared here
operator* function Declared here
operator++ function Declared here
operator++ function Declared here
iterator_category typedef Declared here
difference_type typedef Declared here
value_type typedef Declared here
pointer typedef Declared here
reference typedef Declared here
m_view variable Declared here
m_idx variable Declared here
Name Description
operator== inline
operator!= inline

inline

friend inline bool operator==(const IteratorImpl & a, const IteratorImpl & b)

Defined in src/lib/ncarray/array_impl.hh:1780


inline

friend inline bool operator!=(const IteratorImpl & a, const IteratorImpl & b)

Defined in src/lib/ncarray/array_impl.hh:1784

Return Name Description
IteratorImpl inline
reference operator* const inline
IteratorImpl & operator++ inline
IteratorImpl operator++ inline

inline

inline IteratorImpl(VT view, ssize_t idx)

Defined in src/lib/ncarray/array_impl.hh:1762


const inline

inline reference operator*() const

Defined in src/lib/ncarray/array_impl.hh:1767


inline

inline IteratorImpl & operator++()

Defined in src/lib/ncarray/array_impl.hh:1770


inline

inline IteratorImpl operator++(int)

Defined in src/lib/ncarray/array_impl.hh:1774

Name Description
iterator_category
difference_type
value_type
pointer
reference

using iterator_category = std::input_iterator_tag

Defined in src/lib/ncarray/array_impl.hh:1755


using difference_type = std::ptrdiff_t

Defined in src/lib/ncarray/array_impl.hh:1756


using value_type = ViewType

Defined in src/lib/ncarray/array_impl.hh:1757


using pointer = void

Defined in src/lib/ncarray/array_impl.hh:1759


using reference = value_type

Defined in src/lib/ncarray/array_impl.hh:1760

Return Name Description
VT m_view
ssize_t m_idx

VT m_view

Defined in src/lib/ncarray/array_impl.hh:1790


ssize_t m_idx

Defined in src/lib/ncarray/array_impl.hh:1791