4 #ifndef DUNE_ITERATORFACADES_HH
5 #define DUNE_ITERATORFACADES_HH
135 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
137 public std::iterator< std::forward_iterator_tag,
138 typename remove_const<V>::type,
194 return static_cast<DerivedType const*
>(
this)->dereference();
199 return &(
static_cast<const DerivedType *
>(
this)->dereference());
205 static_cast<DerivedType *
>(
this)->increment();
206 return *
static_cast<DerivedType *
>(
this);
212 DerivedType tmp(static_cast<DerivedType const&>(*
this));
228 template<
class T1,
class V1,
class R1,
class D,
229 class T2,
class V2,
class R2>
230 inline typename EnableIfInterOperable<T1,T2,bool>::type
235 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
237 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
250 template<
class T1,
class V1,
class R1,
class D,
251 class T2,
class V2,
class R2>
252 inline typename EnableIfInterOperable<T1,T2,bool>::type
257 return !
static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
259 return !
static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
266 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
268 public std::iterator< std::bidirectional_iterator_tag,
269 typename remove_const<V>::type,
326 return static_cast<DerivedType const*
>(
this)->dereference();
331 return &(
static_cast<const DerivedType *
>(
this)->dereference());
337 static_cast<DerivedType *
>(
this)->increment();
338 return *
static_cast<DerivedType *
>(
this);
344 DerivedType tmp(static_cast<DerivedType const&>(*
this));
353 static_cast<DerivedType *
>(
this)->decrement();
354 return *
static_cast<DerivedType *
>(
this);
360 DerivedType tmp(static_cast<DerivedType const&>(*
this));
373 template<
class T1,
class V1,
class R1,
class D,
374 class T2,
class V2,
class R2>
375 inline typename enable_if<Conversion<T2,T1>::exists,
bool>::type
379 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
390 template<
class T1,
class V1,
class R1,
class D,
391 class T2,
class V2,
class R2>
393 typename enable_if<Conversion<T1,T2>::exists && !Conversion<T2,T1>::exists,
398 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
411 template<
class T1,
class V1,
class R1,
class D,
412 class T2,
class V2,
class R2>
413 inline typename EnableIfInterOperable<T1,T2,bool>::type
417 return !(lhs == rhs);
424 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
426 public std::iterator< std::random_access_iterator_tag,
427 typename remove_const<V>::type,
492 return static_cast<DerivedType const*
>(
this)->dereference();
497 return &(
static_cast<const DerivedType *
>(
this)->dereference());
507 return static_cast<const DerivedType *
>(
this)->elementAt(n);
513 static_cast<DerivedType *
>(
this)->increment();
514 return *
static_cast<DerivedType *
>(
this);
520 DerivedType tmp(static_cast<DerivedType const&>(*
this));
527 static_cast<DerivedType *
>(
this)->advance(n);
528 return *
static_cast<DerivedType *
>(
this);
533 DerivedType tmp(static_cast<DerivedType const&>(*
this));
542 static_cast<DerivedType *
>(
this)->decrement();
543 return *
static_cast<DerivedType *
>(
this);
549 DerivedType tmp(static_cast<DerivedType const&>(*
this));
556 static_cast<DerivedType *
>(
this)->advance(-n);
557 return *
static_cast<DerivedType *
>(
this);
562 DerivedType tmp(static_cast<DerivedType const&>(*
this));
580 template<
class T1,
class V1,
class R1,
class D,
581 class T2,
class V2,
class R2>
582 inline typename EnableIfInterOperable<T1,T2,bool>::type
587 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
589 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
602 template<
class T1,
class V1,
class R1,
class D,
603 class T2,
class V2,
class R2>
604 inline typename EnableIfInterOperable<T1,T2,bool>::type
609 return !
static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
611 return !
static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
624 template<
class T1,
class V1,
class R1,
class D,
625 class T2,
class V2,
class R2>
626 inline typename EnableIfInterOperable<T1,T2,bool>::type
627 operator<(const RandomAccessIteratorFacade<T1,V1,R1,D>& lhs,
631 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))>0;
633 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))<0;
647 template<
class T1,
class V1,
class R1,
class D,
648 class T2,
class V2,
class R2>
649 inline typename EnableIfInterOperable<T1,T2,bool>::type
650 operator<=(const RandomAccessIteratorFacade<T1,V1,R1,D>& lhs,
654 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))>=0;
656 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))<=0;
670 template<
class T1,
class V1,
class R1,
class D,
671 class T2,
class V2,
class R2>
672 inline typename EnableIfInterOperable<T1,T2,bool>::type
677 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))<0;
679 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))>0;
692 template<
class T1,
class V1,
class R1,
class D,
693 class T2,
class V2,
class R2>
694 inline typename EnableIfInterOperable<T1,T2,bool>::type
699 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))<=0;
701 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))>=0;
714 template<
class T1,
class V1,
class R1,
class D,
715 class T2,
class V2,
class R2>
716 inline typename EnableIfInterOperable<T1,T2,D>::type
721 return -
static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs));
723 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs));
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:231
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:316
DerivedType & operator--()
Predecrement operator.
Definition: iteratorfacades.hh:540
Reference operator[](DifferenceType n) const
Get the element n positions from the current one.
Definition: iteratorfacades.hh:505
Traits for type conversions and type information.
Dune namespace.
Definition: alignment.hh:13
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:136
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:335
DerivedType operator-(DifferenceType n) const
Definition: iteratorfacades.hh:560
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:477
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:306
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:518
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:210
Pointer operator->() const
Definition: iteratorfacades.hh:197
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:490
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:267
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:184
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:487
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:482
DerivedType operator--(int)
Postdecrement operator.
Definition: iteratorfacades.hh:547
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:169
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:511
void advance(DifferenceType n)
Definition: densevector.hh:181
DerivedType & operator--()
Preincrement operator.
Definition: iteratorfacades.hh:351
bool operator>=(const array< T, N > &a, const array< T, N > &b)
Definition: array.hh:151
Pointer operator->() const
Definition: iteratorfacades.hh:329
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:301
DerivedType operator--(int)
Postincrement operator.
Definition: iteratorfacades.hh:358
bool operator>(const array< T, N > &a, const array< T, N > &b)
Definition: array.hh:139
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:179
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:321
DerivedType operator+(DifferenceType n) const
Definition: iteratorfacades.hh:531
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:192
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:467
Pointer operator->() const
Definition: iteratorfacades.hh:495
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:253
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:189
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:472
bigunsignedint< k > operator-(const bigunsignedint< k > &x, std::size_t y)
Definition: bigunsignedint.hh:492
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:425
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:311
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:342
DerivedType & operator+=(DifferenceType n)
Definition: iteratorfacades.hh:525
Checks wether a type is convertible to another.
Definition: typetraits.hh:212
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:174
DerivedType & operator-=(DifferenceType n)
Definition: iteratorfacades.hh:554
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:203
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:324