3 #ifndef DUNE_ITERATORFACADES_HH
4 #define DUNE_ITERATORFACADES_HH
134 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
136 public std::iterator< std::forward_iterator_tag,
137 typename remove_const<V>::type,
193 return static_cast<DerivedType const*
>(
this)->dereference();
198 return &(
static_cast<const DerivedType *
>(
this)->dereference());
211 DerivedType tmp(static_cast<DerivedType const&>(*
this));
227 template<
class T1,
class V1,
class R1,
class D,
228 class T2,
class V2,
class R2>
229 inline typename EnableIfInterOperable<T1,T2,bool>::type
234 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
236 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
249 template<
class T1,
class V1,
class R1,
class D,
250 class T2,
class V2,
class R2>
251 inline typename EnableIfInterOperable<T1,T2,bool>::type
256 return !
static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
258 return !
static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
265 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
267 public std::iterator< std::bidirectional_iterator_tag,
268 typename remove_const<V>::type,
325 return static_cast<DerivedType const*
>(
this)->dereference();
330 return &(
static_cast<const DerivedType *
>(
this)->dereference());
343 DerivedType tmp(static_cast<DerivedType const&>(*
this));
359 DerivedType tmp(static_cast<DerivedType const&>(*
this));
372 template<
class T1,
class V1,
class R1,
class D,
373 class T2,
class V2,
class R2>
374 inline typename enable_if<Conversion<T2,T1>::exists,
bool>::type
378 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
389 template<
class T1,
class V1,
class R1,
class D,
390 class T2,
class V2,
class R2>
392 typename enable_if<Conversion<T1,T2>::exists && !Conversion<T2,T1>::exists,
397 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
410 template<
class T1,
class V1,
class R1,
class D,
411 class T2,
class V2,
class R2>
412 inline typename EnableIfInterOperable<T1,T2,bool>::type
416 return !(lhs == rhs);
423 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
425 public std::iterator< std::random_access_iterator_tag,
426 typename remove_const<V>::type,
491 return static_cast<DerivedType const*
>(
this)->dereference();
496 return &(
static_cast<const DerivedType *
>(
this)->dereference());
506 return static_cast<const DerivedType *
>(
this)->elementAt(n);
519 DerivedType tmp(static_cast<DerivedType const&>(*
this));
532 DerivedType tmp(static_cast<DerivedType const&>(*
this));
548 DerivedType tmp(static_cast<DerivedType const&>(*
this));
561 DerivedType tmp(static_cast<DerivedType const&>(*
this));
579 template<
class T1,
class V1,
class R1,
class D,
580 class T2,
class V2,
class R2>
581 inline typename EnableIfInterOperable<T1,T2,bool>::type
586 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
588 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
601 template<
class T1,
class V1,
class R1,
class D,
602 class T2,
class V2,
class R2>
603 inline typename EnableIfInterOperable<T1,T2,bool>::type
608 return !
static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
610 return !
static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
623 template<
class T1,
class V1,
class R1,
class D,
624 class T2,
class V2,
class R2>
625 inline typename EnableIfInterOperable<T1,T2,bool>::type
626 operator<(const RandomAccessIteratorFacade<T1,V1,R1,D>& lhs,
630 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))>0;
632 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))<0;
646 template<
class T1,
class V1,
class R1,
class D,
647 class T2,
class V2,
class R2>
648 inline typename EnableIfInterOperable<T1,T2,bool>::type
649 operator<=(const RandomAccessIteratorFacade<T1,V1,R1,D>& lhs,
653 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))>=0;
655 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))<=0;
669 template<
class T1,
class V1,
class R1,
class D,
670 class T2,
class V2,
class R2>
671 inline typename EnableIfInterOperable<T1,T2,bool>::type
676 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))<0;
678 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))>0;
691 template<
class T1,
class V1,
class R1,
class D,
692 class T2,
class V2,
class R2>
693 inline typename EnableIfInterOperable<T1,T2,bool>::type
698 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))<=0;
700 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))>=0;
713 template<
class T1,
class V1,
class R1,
class D,
714 class T2,
class V2,
class R2>
715 inline typename EnableIfInterOperable<T1,T2,D>::type
720 return -
static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs));
722 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs));
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:320
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:266
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:486
Information about an index residing on another processor.
Definition: remoteindices.hh:48
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:424
Pointer operator->() const
Definition: iteratorfacades.hh:494
Reference operator[](DifferenceType n) const
Get the element n positions from the current one.
Definition: iteratorfacades.hh:504
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:178
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:471
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:209
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:310
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:341
DerivedType & operator-=(DifferenceType n)
Definition: iteratorfacades.hh:553
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:489
DerivedType operator-(DifferenceType n) const
Definition: iteratorfacades.hh:559
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:476
bigunsignedint< k > operator-(const bigunsignedint< k > &x, std::uintmax_t y)
Definition: bigunsignedint.hh:520
void advance(difference_type n)
Definition: arraylist.hh:579
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:481
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:305
EnableIfInterOperable< T1, T2, bool >::type operator>(const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
Comparison operator.
Definition: iteratorfacades.hh:672
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:191
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:183
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:466
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:230
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:173
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:168
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:315
A constant random access iterator for the Dune::ArrayList class.
Definition: arraylist.hh:20
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition: iteratorfacades.hh:252
EnableIfInterOperable< T1, T2, bool >::type operator>=(const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
Comparison operator.
Definition: iteratorfacades.hh:694
Pointer operator->() const
Definition: iteratorfacades.hh:196
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:135
Checks wether a type is convertible to another.
Definition: typetraits.hh:176
Pointer operator->() const
Definition: iteratorfacades.hh:328
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:517
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:300
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:510
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:323
DerivedType operator+(DifferenceType n) const
Definition: iteratorfacades.hh:530
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:334
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:202
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:188
DerivedType & operator--()
Preincrement operator.
Definition: iteratorfacades.hh:350
DerivedType & operator+=(DifferenceType n)
Definition: iteratorfacades.hh:524
DerivedType operator--(int)
Postdecrement operator.
Definition: iteratorfacades.hh:546
Traits for type conversions and type information.
DerivedType & operator--()
Predecrement operator.
Definition: iteratorfacades.hh:539
Iterator class for sparse vector-like containers.
Definition: diagonalmatrix.hh:33
DerivedType operator--(int)
Postincrement operator.
Definition: iteratorfacades.hh:357