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());
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());
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>
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);
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
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
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));
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:273
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:324
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:301
DerivedType & operator--()
Preincrement operator.
Definition: iteratorfacades.hh:351
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:335
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:311
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:321
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:342
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:316
DerivedType operator--(int)
Postincrement operator.
Definition: iteratorfacades.hh:358
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:306
Checks wether a type is convertible to another.
Definition: typetraits.hh:213
@ exists
True if the conversion exists.
Definition: typetraits.hh:223
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:142
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:203
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:189
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:169
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:174
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:210
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:179
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:192
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:431
DerivedType operator--(int)
Postdecrement operator.
Definition: iteratorfacades.hh:547
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:490
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:511
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:482
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
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:467
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:477
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:518
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:472
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:487
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
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
Dune namespace.
Definition: alignment.hh:14
Traits for type conversions and type information.