3 #ifndef DUNE_ITERATORFACADES_HH
4 #define DUNE_ITERATORFACADES_HH
137 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
198 return static_cast<DerivedType const*
>(
this)->dereference();
203 return &(
static_cast<const DerivedType *
>(
this)->dereference());
232 template<
class T1,
class V1,
class R1,
class D,
233 class T2,
class V2,
class R2>
234 inline typename EnableIfInterOperable<T1,T2,bool>::type
238 if(std::is_convertible<T2,T1>::value)
239 return static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
241 return static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
254 template<
class T1,
class V1,
class R1,
class D,
255 class T2,
class V2,
class R2>
256 inline typename EnableIfInterOperable<T1,T2,bool>::type
260 if(std::is_convertible<T2,T1>::value)
261 return !
static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
263 return !
static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
270 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
332 return static_cast<DerivedType const*
>(
this)->dereference();
337 return &(
static_cast<const DerivedType *
>(
this)->dereference());
379 template<
class T1,
class V1,
class R1,
class D,
380 class T2,
class V2,
class R2>
381 inline typename std::enable_if<std::is_convertible<T2,T1>::value,
bool>::type
385 return static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
396 template<
class T1,
class V1,
class R1,
class D,
397 class T2,
class V2,
class R2>
399 typename std::enable_if<std::is_convertible<T1,T2>::value && !std::is_convertible<T2,T1>::value,
404 return static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
417 template<
class T1,
class V1,
class R1,
class D,
418 class T2,
class V2,
class R2>
419 inline typename EnableIfInterOperable<T1,T2,bool>::type
423 return !(lhs == rhs);
430 template<
class T,
class V,
class R = V&,
class D = std::ptrdiff_t>
500 return static_cast<DerivedType const*
>(
this)->dereference();
505 return &(
static_cast<const DerivedType *
>(
this)->dereference());
515 return static_cast<const DerivedType *
>(
this)->elementAt(n);
588 template<
class T1,
class V1,
class R1,
class D,
589 class T2,
class V2,
class R2>
590 inline typename EnableIfInterOperable<T1,T2,bool>::type
594 if(std::is_convertible<T2,T1>::value)
595 return static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
597 return static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
610 template<
class T1,
class V1,
class R1,
class D,
611 class T2,
class V2,
class R2>
612 inline typename EnableIfInterOperable<T1,T2,bool>::type
616 if(std::is_convertible<T2,T1>::value)
617 return !
static_cast<const T1&
>(lhs).equals(
static_cast<const T2&
>(rhs));
619 return !
static_cast<const T2&
>(rhs).equals(
static_cast<const T1&
>(lhs));
632 template<
class T1,
class V1,
class R1,
class D,
633 class T2,
class V2,
class R2>
638 if(std::is_convertible<T2,T1>::value)
639 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))>0;
641 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))<0;
655 template<
class T1,
class V1,
class R1,
class D,
656 class T2,
class V2,
class R2>
661 if(std::is_convertible<T2,T1>::value)
662 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))>=0;
664 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))<=0;
678 template<
class T1,
class V1,
class R1,
class D,
679 class T2,
class V2,
class R2>
680 inline typename EnableIfInterOperable<T1,T2,bool>::type
684 if(std::is_convertible<T2,T1>::value)
685 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))<0;
687 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))>0;
700 template<
class T1,
class V1,
class R1,
class D,
701 class T2,
class V2,
class R2>
702 inline typename EnableIfInterOperable<T1,T2,bool>::type
706 if(std::is_convertible<T2,T1>::value)
707 return static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs))<=0;
709 return static_cast<const T2&
>(rhs).distanceTo(
static_cast<const T1&
>(lhs))>=0;
722 template<
class T1,
class V1,
class R1,
class D,
723 class T2,
class V2,
class R2>
724 inline typename EnableIfInterOperable<T1,T2,D>::type
728 if(std::is_convertible<T2,T1>::value)
729 return -
static_cast<const T1&
>(lhs).distanceTo(
static_cast<const T2&
>(rhs));
731 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:537
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:681
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:635
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:703
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:658
Dune namespace.
Definition: alignedallocator.hh:14
constexpr bool operator!=(const DebugAllocator< T > &, const DebugAllocator< T > &)
check whether allocators are not equivalent
Definition: debugallocator.hh:318
constexpr bool operator==(const DebugAllocator< T > &, const DebugAllocator< T > &)
check whether allocators are equivalent
Definition: debugallocator.hh:310
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:139
std::forward_iterator_tag iterator_category
Definition: iteratorfacades.hh:143
V * pointer
Definition: iteratorfacades.hh:146
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:188
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:193
Pointer operator->() const
Definition: iteratorfacades.hh:201
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:173
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:178
typename std::remove_const< V >::type value_type
Definition: iteratorfacades.hh:144
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:207
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:214
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:183
D difference_type
Definition: iteratorfacades.hh:145
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:196
R reference
Definition: iteratorfacades.hh:147
Facade class for stl conformant bidirectional iterators.
Definition: iteratorfacades.hh:272
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:341
V * pointer
Definition: iteratorfacades.hh:279
typename std::remove_const< V >::type value_type
Definition: iteratorfacades.hh:277
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:330
DerivedType & operator--()
Preincrement operator.
Definition: iteratorfacades.hh:357
D difference_type
Definition: iteratorfacades.hh:278
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:307
Pointer operator->() const
Definition: iteratorfacades.hh:335
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:317
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:327
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:348
std::bidirectional_iterator_tag iterator_category
Definition: iteratorfacades.hh:276
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:322
DerivedType operator--(int)
Postincrement operator.
Definition: iteratorfacades.hh:364
R reference
Definition: iteratorfacades.hh:280
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:312
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:432
typename std::remove_const< V >::type value_type
Definition: iteratorfacades.hh:437
D difference_type
Definition: iteratorfacades.hh:438
DerivedType operator--(int)
Postdecrement operator.
Definition: iteratorfacades.hh:555
DerivedType & operator--()
Predecrement operator.
Definition: iteratorfacades.hh:548
V * pointer
Definition: iteratorfacades.hh:439
std::random_access_iterator_tag iterator_category
Definition: iteratorfacades.hh:436
Reference operator*() const
Dereferencing operator.
Definition: iteratorfacades.hh:498
R reference
Definition: iteratorfacades.hh:440
Pointer operator->() const
Definition: iteratorfacades.hh:503
D DifferenceType
The type of the difference between two positions.
Definition: iteratorfacades.hh:490
DerivedType & operator++()
Preincrement operator.
Definition: iteratorfacades.hh:519
DerivedType operator+(DifferenceType n) const
Definition: iteratorfacades.hh:539
DerivedType & operator+=(DifferenceType n)
Definition: iteratorfacades.hh:533
Reference operator[](DifferenceType n) const
Get the element n positions from the current one.
Definition: iteratorfacades.hh:513
DerivedType & operator-=(DifferenceType n)
Definition: iteratorfacades.hh:562
T DerivedType
The type of derived iterator.
Definition: iteratorfacades.hh:475
V * Pointer
The pointer to the Value.
Definition: iteratorfacades.hh:485
DerivedType operator-(DifferenceType n) const
Definition: iteratorfacades.hh:568
DerivedType operator++(int)
Postincrement operator.
Definition: iteratorfacades.hh:526
V Value
The type of value accessed through the iterator.
Definition: iteratorfacades.hh:480
R Reference
The type of the reference to the values accessed.
Definition: iteratorfacades.hh:495
Enable typedef if two types are interoperable.
Definition: typetraits.hh:83