Go to the documentation of this file.
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());
230 template<
class T1,
class V1,
class R1,
class D,
231 class T2,
class V2,
class R2>
232 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
254 inline typename EnableIfInterOperable<T1,T2,bool>::type
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());
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>
415 inline typename EnableIfInterOperable<T1,T2,bool>::type
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);
582 template<
class T1,
class V1,
class R1,
class D,
583 class T2,
class V2,
class R2>
584 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
606 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
628 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
651 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
674 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
696 inline typename EnableIfInterOperable<T1,T2,bool>::type
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>
718 inline typename EnableIfInterOperable<T1,T2,D>::type
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));
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:469
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:629
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:212
DerivedType operator+(DifferenceType n) const
Definition: iteratorfacades.hh:533
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:513
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
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:474
Dune namespace.
Definition: alignedallocator.hh:9
DerivedType & operator--()
Preincrement operator.
Definition: iteratorfacades.hh:353
bigunsignedint< k > operator-(const bigunsignedint< k > &x, std::uintmax_t y)
Definition: bigunsignedint.hh:536
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:318
DerivedType & operator+=(DifferenceType n)
Definition: iteratorfacades.hh:527
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:269
DerivedType operator--(int)
Postdecrement operator.
Definition: iteratorfacades.hh:549
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:313
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:652
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:520
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
DerivedType & operator--()
Predecrement operator.
Definition: iteratorfacades.hh:542
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:308
Pointer operator->() const
Definition: iteratorfacades.hh:331
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:138
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:326
Pointer operator->() const
Definition: iteratorfacades.hh:199
Reference operator[](DifferenceType n) const
Get the element n positions from the current one.
Definition: iteratorfacades.hh:507
DerivedType operator-(DifferenceType n) const
Definition: iteratorfacades.hh:562
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:479
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:176
Generic iterator class for dense vector and matrix implementations.
Definition: densevector.hh:126
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
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:171
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:344
Pointer operator->() const
Definition: iteratorfacades.hh:497
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:492
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:337
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:303
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:205
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:186
DerivedType operator--(int)
Postincrement operator.
Definition: iteratorfacades.hh:360
void advance(DifferenceType n)
Definition: densevector.hh:193
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:323
DerivedType & operator-=(DifferenceType n)
Definition: iteratorfacades.hh:556
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:181
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:489
Traits for type conversions and type information.
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:191
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
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:427
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:194
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:484