3 #ifndef DUNE_ITERATORFACADES_HH 4 #define DUNE_ITERATORFACADES_HH 137 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
139 public std::iterator< std::forward_iterator_tag,
140 typename std::remove_const<V>::type,
196 return static_cast<DerivedType const*
>(
this)->dereference();
201 return &(
static_cast<const DerivedType *
>(
this)->dereference());
207 static_cast<DerivedType *
>(
this)->increment();
208 return *
static_cast<DerivedType *
>(
this);
214 DerivedType tmp(static_cast<DerivedType const&>(*
this));
230 template<
class T1,
class V1,
class R1,
class D,
231 class T2,
class V2,
class R2>
236 if(std::is_convertible<T2,T1>::value)
237 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
239 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
252 template<
class T1,
class V1,
class R1,
class D,
253 class T2,
class V2,
class R2>
258 if(std::is_convertible<T2,T1>::value)
259 return !
static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
261 return !
static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
268 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
270 public std::iterator< std::bidirectional_iterator_tag,
271 typename std::remove_const<V>::type,
328 return static_cast<DerivedType const*
>(
this)->dereference();
333 return &(
static_cast<const DerivedType *
>(
this)->dereference());
339 static_cast<DerivedType *
>(
this)->increment();
340 return *
static_cast<DerivedType *
>(
this);
346 DerivedType tmp(static_cast<DerivedType const&>(*
this));
355 static_cast<DerivedType *
>(
this)->decrement();
356 return *
static_cast<DerivedType *
>(
this);
362 DerivedType tmp(static_cast<DerivedType const&>(*
this));
375 template<
class T1,
class V1,
class R1,
class D,
376 class T2,
class V2,
class R2>
377 inline typename std::enable_if<std::is_convertible<T2,T1>::value,
bool>::type
381 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
392 template<
class T1,
class V1,
class R1,
class D,
393 class T2,
class V2,
class R2>
395 typename std::enable_if<std::is_convertible<T1,T2>::value && !std::is_convertible<T2,T1>::value,
400 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
413 template<
class T1,
class V1,
class R1,
class D,
414 class T2,
class V2,
class R2>
419 return !(lhs == rhs);
426 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
428 public std::iterator< std::random_access_iterator_tag,
429 typename std::remove_const<V>::type,
494 return static_cast<DerivedType const*
>(
this)->dereference();
499 return &(
static_cast<const DerivedType *
>(
this)->dereference());
509 return static_cast<const DerivedType *
>(
this)->elementAt(n);
515 static_cast<DerivedType *
>(
this)->increment();
516 return *
static_cast<DerivedType *
>(
this);
522 DerivedType tmp(static_cast<DerivedType const&>(*
this));
529 static_cast<DerivedType *
>(
this)->advance(n);
530 return *
static_cast<DerivedType *
>(
this);
535 DerivedType tmp(static_cast<DerivedType const&>(*
this));
544 static_cast<DerivedType *
>(
this)->decrement();
545 return *
static_cast<DerivedType *
>(
this);
551 DerivedType tmp(static_cast<DerivedType const&>(*
this));
558 static_cast<DerivedType *
>(
this)->advance(-n);
559 return *
static_cast<DerivedType *
>(
this);
564 DerivedType tmp(static_cast<DerivedType const&>(*
this));
582 template<
class T1,
class V1,
class R1,
class D,
583 class T2,
class V2,
class R2>
588 if(std::is_convertible<T2,T1>::value)
589 return static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
591 return static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
604 template<
class T1,
class V1,
class R1,
class D,
605 class T2,
class V2,
class R2>
610 if(std::is_convertible<T2,T1>::value)
611 return !
static_cast<const T1&
>(lhs).equals(static_cast<const T2&>(rhs));
613 return !
static_cast<const T2&
>(rhs).equals(static_cast<const T1&>(lhs));
626 template<
class T1,
class V1,
class R1,
class D,
627 class T2,
class V2,
class R2>
629 operator<(const RandomAccessIteratorFacade<T1,V1,R1,D>& lhs,
632 if(std::is_convertible<T2,T1>::value)
633 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))>0;
635 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))<0;
649 template<
class T1,
class V1,
class R1,
class D,
650 class T2,
class V2,
class R2>
652 operator<=(const RandomAccessIteratorFacade<T1,V1,R1,D>& lhs,
655 if(std::is_convertible<T2,T1>::value)
656 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))>=0;
658 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))<=0;
672 template<
class T1,
class V1,
class R1,
class D,
673 class T2,
class V2,
class R2>
678 if(std::is_convertible<T2,T1>::value)
679 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))<0;
681 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))>0;
694 template<
class T1,
class V1,
class R1,
class D,
695 class T2,
class V2,
class R2>
700 if(std::is_convertible<T2,T1>::value)
701 return static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs))<=0;
703 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs))>=0;
716 template<
class T1,
class V1,
class R1,
class D,
717 class T2,
class V2,
class R2>
722 if(std::is_convertible<T2,T1>::value)
723 return -
static_cast<const T1&
>(lhs).distanceTo(static_cast<const T2&>(rhs));
725 return static_cast<const T2&
>(rhs).distanceTo(static_cast<const T1&>(lhs));
DerivedType & operator--()
Predecrement operator.
Definition: iteratorfacades.hh:542
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:513
DerivedType operator--(int)
Postdecrement operator.
Definition: iteratorfacades.hh:549
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:176
bigunsignedint< k > operator-(const bigunsignedint< k > &x, std::uintmax_t y)
Definition: bigunsignedint.hh:536
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:479
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:520
Enable typedef if two types are interoperable.
Definition: typetraits.hh:80
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:323
DerivedType operator+(DifferenceType n) const
Definition: iteratorfacades.hh:533
Pointer operator->() const
Definition: iteratorfacades.hh:199
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:233
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:181
DerivedType & operator-=(DifferenceType n)
Definition: iteratorfacades.hh:556
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:344
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:675
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:337
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:318
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:171
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:255
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:427
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:313
Dune namespace.
Definition: alignedallocator.hh:9
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:474
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:194
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:303
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:469
DerivedType operator--(int)
Postincrement operator.
Definition: iteratorfacades.hh:360
DerivedType & operator+=(DifferenceType n)
Definition: iteratorfacades.hh:527
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:308
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:205
DerivedType operator-(DifferenceType n) const
Definition: iteratorfacades.hh:562
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:484
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:186
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:697
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:269
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:489
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:326
Pointer operator->() const
Definition: iteratorfacades.hh:497
DerivedType & operator--()
Preincrement operator.
Definition: iteratorfacades.hh:353
Reference operator[](DifferenceType n) const
Get the element n positions from the current one.
Definition: iteratorfacades.hh:507
Traits for type conversions and type information.
void advance(difference_type n)
Definition: arraylist.hh:579
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:138
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:492
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:191
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:212
Pointer operator->() const
Definition: iteratorfacades.hh:331