5 #ifndef DUNE_GENERICITERATOR_HH 6 #define DUNE_GENERICITERATOR_HH 149 template<
class C,
class T,
class R=T&,
class D = std::ptrdiff_t,
152 public IteratorFacade<GenericIterator<C,T,R,D,IteratorFacade>,T,R,D>
155 friend class
GenericIterator<const typename std::remove_const<C>::type, const typename std::remove_const<T>::type, typename const_reference<R>::type, D, IteratorFacade>;
157 typedef
GenericIterator<typename std::remove_const<C>::type, typename std::remove_const<T>::type, typename mutable_reference<R>::type, D, IteratorFacade>
MutableIterator;
158 typedef
GenericIterator<const typename std::remove_const<C>::type, const typename std::remove_const<T>::type, typename const_reference<R>::type, D, IteratorFacade>
ConstIterator;
201 : container_(&cont), position_(pos)
229 return position_ == other.position_ && container_ == other.container_;
234 return position_ == other.position_ && container_ == other.container_;
238 return container_->operator[](position_);
252 return container_->operator[](position_+
i);
256 position_=position_+n;
261 assert(other.container_==container_);
262 return other.position_ - position_;
267 assert(other.container_==container_);
268 return other.position_ - position_;
bool equals(const ConstIterator &other) const
Definition: genericiterator.hh:232
const R & type
Definition: genericiterator.hh:106
void decrement()
Definition: genericiterator.hh:246
const R & type
Definition: genericiterator.hh:100
const R type
Definition: genericiterator.hh:94
This file implements iterator facade classes for writing stl conformant iterators.
Reference dereference() const
Definition: genericiterator.hh:237
Generic class for stl-conforming iterators for container classes with operator[]. ...
Definition: genericiterator.hh:151
void increment()
Definition: genericiterator.hh:241
R type
Definition: genericiterator.hh:117
const R type
Definition: genericiterator.hh:88
I i
Definition: hybridmultiindex.hh:328
DifferenceType distanceTo(const ConstIterator &other) const
Definition: genericiterator.hh:265
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:434
Reference elementAt(DifferenceType i) const
Definition: genericiterator.hh:251
GenericIterator(const ConstIterator &other)
Copy constructor.
Definition: genericiterator.hh:223
Dune namespace
Definition: alignedallocator.hh:12
get the 'mutable' version of a reference to a const object
Definition: genericiterator.hh:115
C Container
The type of container we are an iterator for.
Definition: genericiterator.hh:170
R & type
Definition: genericiterator.hh:135
void advance(DifferenceType n)
Definition: genericiterator.hh:255
T Value
The value type of the iterator.
Definition: genericiterator.hh:177
R & type
Definition: genericiterator.hh:129
CRTP-Mixing class for stl conformant iterators of given iterator category.
Definition: iteratorfacades.hh:1052
bool equals(const MutableIterator &other) const
Definition: genericiterator.hh:227
DifferenceType distanceTo(const MutableIterator &other) const
Definition: genericiterator.hh:259
D DifferenceType
The type of the difference between two positions.
Definition: genericiterator.hh:182
Get the 'const' version of a reference to a mutable object.
Definition: genericiterator.hh:86
R type
Definition: genericiterator.hh:123
R Reference
The type of the reference to the values accessed.
Definition: genericiterator.hh:187
GenericIterator(Container &cont, DifferenceType pos)
Constructor.
Definition: genericiterator.hh:200
GenericIterator(const MutableIterator &other)
Copy constructor.
Definition: genericiterator.hh:211