Generic class for stl-conforming iterators for container classes with operator[].
More...
template<class C, class T, class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
class Dune::GenericIterator< C, T, R, D, IteratorFacade >
Generic class for stl-conforming iterators for container classes with operator[].
If template parameter C has a const qualifier we are a const iterator, otherwise we are a mutable iterator.
template<class C , class T , class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
The type of container we are an iterator for.
The container type must provide an operator[] method.
If C has a const qualifier we are a const iterator, otherwise we are a mutable iterator.
template<class C , class T , class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
The type of the difference between two positions.
template<class C , class T , class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
The type of the reference to the values accessed.
template<class C , class T , class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
The value type of the iterator.
This is the return type when dereferencing the iterator.
template<class C , class T , class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
Copy constructor.
This is somehow hard to understand, therefore play with the cases:
- if we are mutable this is the only valid copy constructor, as the argument is a mutable iterator
- if we are a const iterator the argument is a mutable iterator => This is the needed conversion to initialize a const iterator from a mutable one.
template<class C , class T , class R = T&, class D = std::ptrdiff_t, template< class, class, class, class > class IteratorFacade = RandomAccessIteratorFacade>
Copy constructor.
- Warning
- Calling this method results in a compiler error, if this is a mutable iterator.
This is somehow hard to understand, therefore play with the cases:
- if we are mutable the arguments is a const iterator and therefore calling this method is mistake in the user's code and results in a (probably not understandable) compiler error
- If we are a const iterator this is the default copy constructor as the argument is a const iterator too.