Loading...
Searching...
No Matches
iteratorfacades.hh File Reference

This file implements iterator facade classes for writing stl conformant iterators. More...

`#include <iterator>`
`#include <type_traits>`
`#include <dune/common/typetraits.hh>`
`#include <dune/common/concept.hh>`

Go to the source code of this file.

## Classes

class | Dune::ForwardIteratorFacade< T, V, R, D >
| Base class for stl conformant forward iterators. More...
class | Dune::BidirectionalIteratorFacade< T, V, R, D >
| Facade class for stl conformant bidirectional iterators. More...
class | Dune::RandomAccessIteratorFacade< T, V, R, D >
| Base class for stl conformant forward iterators. More...
class | Dune::ProxyArrowResult< ProxyType >
| Helper to mimic a pointer for proxy objects. More...
struct | Dune::IteratorFacadeAccess
| This class encapsulates access of IteratorFacade. More...
struct | Dune::DefaultIteratorTraits< IteratorCategory, Reference, DifferenceType >
| An iterator_traits class providing sensible defaults. More...

## Namespaces

namespace | Dune
| Dune namespace

## Typedefs

template<class IteratorImpl, class IteratorTraits>
using | Dune::IteratorFacadeForTraits
| Alias for the CRTP-Mixing class IteratorFacade.

## Functions

template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator== (const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for equality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator!= (const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for inequality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr std::enable_if< std::is_convertible< T2, T1 >::value, bool >::type | Dune::operator== (const BidirectionalIteratorFacade< T1, V1, R1, D > &lhs, const BidirectionalIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for equality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr std::enable_if< std::is_convertible< T1, T2 >::value &&!std::is_convertible< T2, T1 >::value, bool >::type | Dune::operator== (const BidirectionalIteratorFacade< T1, V1, R1, D > &lhs, const BidirectionalIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for equality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator!= (const BidirectionalIteratorFacade< T1, V1, R1, D > &lhs, const BidirectionalIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for inequality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator== (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for equality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator!= (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Checks for inequality.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator< (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Comparison operator.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator<= (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Comparison operator.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator> (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Comparison operator.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, bool >::type | Dune::operator>= (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Comparison operator.
template<class T1, class V1, class R1, class D, class T2, class V2, class R2>
constexpr EnableIfInterOperable< T1, T2, D >::type | Dune::operator- (const RandomAccessIteratorFacade< T1, V1, R1, D > &lhs, const RandomAccessIteratorFacade< T2, V2, R2, D > &rhs)
| Calculates the difference between two pointers.
constexpr decltype(auto) | Dune::operator* () const
| Dereferencing operator.
constexpr pointer | Dune::operator-> () const
| Arrow access to members of referenced value.
constexpr decltype(auto) | Dune::operator++ ()
| Preincrement operator.
constexpr DerivedIterator | Dune::operator++ (int)
| Postincrement operator.
template<bool dummy = true, std::enable_if_t< isBidirectional and dummy, int > = 0>
constexpr decltype(auto) | Dune::operator-- ()
| Predecrement operator.
template<bool dummy = true, std::enable_if_t< isBidirectional and dummy, int > = 0>
constexpr DerivedIterator | Dune::operator-- (int)
| Postdecrement operator.
template<bool dummy = true, std::enable_if_t< isRandomAccess and dummy, int > = 0>
constexpr reference | Dune::operator[] (difference_type n) const
| Dereference element with given offset form this iterator.
template<bool dummy = true, std::enable_if_t< isRandomAccess and dummy, int > = 0>
constexpr decltype(auto) | Dune::operator+= (difference_type n)
| Increment iterator by given value.
template<bool dummy = true, std::enable_if_t< isRandomAccess and dummy, int > = 0>
constexpr DerivedIterator | Dune::operator+ (difference_type n) const
| Create iterator incremented by given value.
template<bool dummy = true, std::enable_if_t< isRandomAccess and dummy, int > = 0>
constexpr DerivedIterator | Dune::operator+ (difference_type n, const IteratorFacade &it)
| Create iterator incremented by given value.
template<bool dummy = true, std::enable_if_t< isRandomAccess and dummy, int > = 0>
constexpr DerivedIterator & | Dune::operator-= (difference_type n)
| Decrement iterator by given value.
template<bool dummy = true, std::enable_if_t< isRandomAccess and dummy, int > = 0>
constexpr DerivedIterator | Dune::operator- (difference_type n) const
| Create iterator decremented by given value.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D1, class D2>
constexpr auto | Dune::operator== (const IteratorFacade< T1, C, V1, R1, P1, D1 > &it1, const IteratorFacade< T2, C, V2, R2, P2, D2 > &it2)
| Equality comparison for IteratorFacade.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D1, class D2, std::enable_if_t< Dune::models< Impl::Concepts::IterEqualsOp, T1, T2 >(), int > = 0>
constexpr bool | Dune::operator!= (const IteratorFacade< T1, C, V1, R1, P1, D1 > &it1, const IteratorFacade< T2, C, V2, R2, P2, D2 > &it2)
| Inequality comparison for IteratorFacade.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D>
constexpr auto | Dune::operator- (const IteratorFacade< T1, C, V1, R1, P1, D > &it1, const IteratorFacade< T2, C, V2, R2, P2, D > &it2)
| Difference for two IteratorFacade objects.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D1, class D2, std::enable_if_t< Dune::models< Impl::Concepts::IterDistanceOp< D1 >, T1, T2 >(), int > = 0>
constexpr bool | Dune::operator< (const IteratorFacade< T1, C, V1, R1, P1, D1 > &it1, const IteratorFacade< T2, C, V2, R2, P2, D2 > &it2)
| Comparison for IteratorFacade.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D1, class D2, std::enable_if_t< Dune::models< Impl::Concepts::IterDistanceOp< D1 >, T1, T2 >(), int > = 0>
constexpr bool | Dune::operator<= (const IteratorFacade< T1, C, V1, R1, P1, D1 > &it1, const IteratorFacade< T2, C, V2, R2, P2, D2 > &it2)
| Comparison for IteratorFacade.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D1, class D2, std::enable_if_t< Dune::models< Impl::Concepts::IterDistanceOp< D1 >, T1, T2 >(), int > = 0>
constexpr bool | Dune::operator> (const IteratorFacade< T1, C, V1, R1, P1, D1 > &it1, const IteratorFacade< T2, C, V2, R2, P2, D2 > &it2)
| Comparison for IteratorFacade.
template<class T1, class T2, class C, class V1, class V2, class R1, class R2, class P1, class P2, class D1, class D2, std::enable_if_t< Dune::models< Impl::Concepts::IterDistanceOp< D1 >, T1, T2 >(), int > = 0>
constexpr bool | Dune::operator>= (const IteratorFacade< T1, C, V1, R1, P1, D1 > &it1, const IteratorFacade< T2, C, V2, R2, P2, D2 > &it2)
| Comparison for IteratorFacade.

## Detailed Description

This file implements iterator facade classes for writing stl conformant iterators.

With using these facades writing iterators for arbitrary containers becomes much less cumbersome as only few functions have to be implemented. All other functions needed by the stl are provided by the facades using the Barton-Nackman trick (also known as curiously recurring template pattern.