5#ifndef DUNE_ITERATORFACADES_HH
6#define DUNE_ITERATORFACADES_HH
139 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
200 return static_cast<DerivedType const*
>(
this)->dereference();
205 return &(
static_cast<const DerivedType *
>(
this)->dereference());
234 template<
class T1,
class V1,
class R1,
class D,
235 class T2,
class V2,
class R2>
236 inline typename EnableIfInterOperable<T1,T2,bool>::type
240 if(std::is_convertible<T2,T1>::value)
241 return static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
243 return static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
256 template<
class T1,
class V1,
class R1,
class D,
257 class T2,
class V2,
class R2>
258 inline typename EnableIfInterOperable<T1,T2,bool>::type
262 if(std::is_convertible<T2,T1>::value)
263 return !
static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
265 return !
static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
272 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
334 return static_cast<DerivedType const*
>(
this)->dereference();
339 return &(
static_cast<const DerivedType *
>(
this)->dereference());
381 template<
class T1,
class V1,
class R1,
class D,
382 class T2,
class V2,
class R2>
383 inline typename std::enable_if<std::is_convertible<T2,T1>::value,
bool>::type
387 return static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
398 template<
class T1,
class V1,
class R1,
class D,
399 class T2,
class V2,
class R2>
401 typename std::enable_if<std::is_convertible<T1,T2>::value && !std::is_convertible<T2,T1>::value,
406 return static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
419 template<
class T1,
class V1,
class R1,
class D,
420 class T2,
class V2,
class R2>
421 inline typename EnableIfInterOperable<T1,T2,bool>::type
425 return !(lhs == rhs);
432 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
502 return static_cast<DerivedType const*
>(
this)->dereference();
507 return &(
static_cast<const DerivedType *
>(
this)->dereference());
517 return static_cast<const DerivedType *
>(
this)->elementAt(n);
590 template<
class T1,
class V1,
class R1,
class D,
591 class T2,
class V2,
class R2>
592 inline typename EnableIfInterOperable<T1,T2,bool>::type
596 if(std::is_convertible<T2,T1>::value)
597 return static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
599 return static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
612 template<
class T1,
class V1,
class R1,
class D,
613 class T2,
class V2,
class R2>
614 inline typename EnableIfInterOperable<T1,T2,bool>::type
618 if(std::is_convertible<T2,T1>::value)
619 return !
static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
621 return !
static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
634 template<
class T1,
class V1,
class R1,
class D,
635 class T2,
class V2,
class R2>
640 if(std::is_convertible<T2,T1>::value)
641 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))>0;
643 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))<0;
657 template<
class T1,
class V1,
class R1,
class D,
658 class T2,
class V2,
class R2>
663 if(std::is_convertible<T2,T1>::value)
664 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))>=0;
666 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))<=0;
680 template<
class T1,
class V1,
class R1,
class D,
681 class T2,
class V2,
class R2>
682 inline typename EnableIfInterOperable<T1,T2,bool>::type
686 if(std::is_convertible<T2,T1>::value)
687 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))<0;
689 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))>0;
702 template<
class T1,
class V1,
class R1,
class D,
703 class T2,
class V2,
class R2>
704 inline typename EnableIfInterOperable<T1,T2,bool>::type
708 if(std::is_convertible<T2,T1>::value)
709 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))<=0;
711 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))>=0;
724 template<
class T1,
class V1,
class R1,
class D,
725 class T2,
class V2,
class R2>
726 inline typename EnableIfInterOperable<T1,T2,D>::type
730 if(std::is_convertible<T2,T1>::value)
731 return -
static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs));
733 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs));
Traits for type conversions and type information.
bigunsignedint< k > operator-(const bigunsignedint< k > &x, std::uintmax_t y)
Definition bigunsignedint.hh:542
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:637
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:683
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:660
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:237
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:705
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:259
Dune namespace.
Definition alignedallocator.hh:13
Base class for stl conformant forward iterators.
Definition iteratorfacades.hh:141
std::forward_iterator_tag iterator_category
Definition iteratorfacades.hh:145
V * pointer
Definition iteratorfacades.hh:148
DerivedType & operator++()
Preincrement operator.
Definition iteratorfacades.hh:209
D DifferenceType
The type of the difference between two positions.
Definition iteratorfacades.hh:190
R Reference
The type of the reference to the values accessed.
Definition iteratorfacades.hh:195
Pointer operator->() const
Definition iteratorfacades.hh:203
T DerivedType
The type of derived iterator.
Definition iteratorfacades.hh:175
V Value
The type of value accessed through the iterator.
Definition iteratorfacades.hh:180
typename std::remove_const< V >::type value_type
Definition iteratorfacades.hh:146
DerivedType operator++(int)
Postincrement operator.
Definition iteratorfacades.hh:216
V * Pointer
The pointer to the Value.
Definition iteratorfacades.hh:185
D difference_type
Definition iteratorfacades.hh:147
Reference operator*() const
Dereferencing operator.
Definition iteratorfacades.hh:198
R reference
Definition iteratorfacades.hh:149
Facade class for stl conformant bidirectional iterators.
Definition iteratorfacades.hh:274
V * pointer
Definition iteratorfacades.hh:281
typename std::remove_const< V >::type value_type
Definition iteratorfacades.hh:279
Reference operator*() const
Dereferencing operator.
Definition iteratorfacades.hh:332
D difference_type
Definition iteratorfacades.hh:280
T DerivedType
The type of derived iterator.
Definition iteratorfacades.hh:309
DerivedType & operator--()
Preincrement operator.
Definition iteratorfacades.hh:359
Pointer operator->() const
Definition iteratorfacades.hh:337
DerivedType & operator++()
Preincrement operator.
Definition iteratorfacades.hh:343
V * Pointer
The pointer to the Value.
Definition iteratorfacades.hh:319
R Reference
The type of the reference to the values accessed.
Definition iteratorfacades.hh:329
DerivedType operator++(int)
Postincrement operator.
Definition iteratorfacades.hh:350
std::bidirectional_iterator_tag iterator_category
Definition iteratorfacades.hh:278
D DifferenceType
The type of the difference between two positions.
Definition iteratorfacades.hh:324
DerivedType operator--(int)
Postincrement operator.
Definition iteratorfacades.hh:366
R reference
Definition iteratorfacades.hh:282
V Value
The type of value accessed through the iterator.
Definition iteratorfacades.hh:314
Base class for stl conformant forward iterators.
Definition iteratorfacades.hh:434
typename std::remove_const< V >::type value_type
Definition iteratorfacades.hh:439
D difference_type
Definition iteratorfacades.hh:440
DerivedType operator--(int)
Postdecrement operator.
Definition iteratorfacades.hh:557
V * pointer
Definition iteratorfacades.hh:441
std::random_access_iterator_tag iterator_category
Definition iteratorfacades.hh:438
Reference operator*() const
Dereferencing operator.
Definition iteratorfacades.hh:500
DerivedType & operator++()
Preincrement operator.
Definition iteratorfacades.hh:521
R reference
Definition iteratorfacades.hh:442
Pointer operator->() const
Definition iteratorfacades.hh:505
D DifferenceType
The type of the difference between two positions.
Definition iteratorfacades.hh:492
DerivedType & operator--()
Predecrement operator.
Definition iteratorfacades.hh:550
DerivedType & operator-=(DifferenceType n)
Definition iteratorfacades.hh:564
DerivedType operator+(DifferenceType n) const
Definition iteratorfacades.hh:541
Reference operator[](DifferenceType n) const
Get the element n positions from the current one.
Definition iteratorfacades.hh:515
T DerivedType
The type of derived iterator.
Definition iteratorfacades.hh:477
V * Pointer
The pointer to the Value.
Definition iteratorfacades.hh:487
DerivedType operator-(DifferenceType n) const
Definition iteratorfacades.hh:570
DerivedType operator++(int)
Postincrement operator.
Definition iteratorfacades.hh:528
V Value
The type of value accessed through the iterator.
Definition iteratorfacades.hh:482
DerivedType & operator+=(DifferenceType n)
Definition iteratorfacades.hh:535
R Reference
The type of the reference to the values accessed.
Definition iteratorfacades.hh:497
Enable typedef if two types are interoperable.
Definition typetraits.hh:81