11#ifndef NDARRAY_DETAIL_NestedIterator_h_INCLUDED
12#define NDARRAY_DETAIL_NestedIterator_h_INCLUDED
20#include <boost/iterator/iterator_facade.hpp>
39template <
typename T,
int N,
int C>
41 NestedIterator<T,N,C>,
42 typename ArrayTraits<T,N,C>::Value,
43 boost::random_access_traversal_tag,
44 typename ArrayTraits<T,N,C>::Reference
53 r._data += n * _stride;
57 Reference const & operator*()
const {
return _ref; }
59 Reference const * operator->() {
return &_ref; }
67 template <
typename T_,
int C_>
72 _ref._data = other._ref._data;
73 _ref._core = other._ref._core;
74 _stride = other._stride;
79 template <
typename T_,
int C_>
81 _ref._data = other._ref._data;
82 _ref._core = other._ref._core;
83 _stride = other._stride;
89 friend class boost::iterator_core_access;
91 template <
typename T_,
int N_,
int C_>
friend class NestedIterator;
93 Reference const & dereference()
const {
return _ref; }
95 void increment() { _ref._data += _stride; }
96 void decrement() { _ref._data -= _stride; }
97 void advance(Offset n) { _ref._data += _stride * n; }
99 template <
typename T_,
int C_>
101 return std::distance(_ref._data, other._ref._data) / _stride;
104 template <
typename T_,
int C_>
106 return _ref._data == other._ref._data;
A proxy class for Array with deep assignment operators.
Definition ArrayRef.h:34
A multidimensional strided array.
Definition Array.h:35
Definition NestedIterator.h:46
Forward declarations and default template parameters for ndarray.