Dune Core Modules (2.8.0)

iteratorrange.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_COMMON_ITERATORRANGE_HH
4#define DUNE_COMMON_ITERATORRANGE_HH
5
6namespace Dune {
7
9
18 template<typename Iterator>
20 {
21
22 public:
23
25 typedef Iterator iterator;
26
28
31 typedef Iterator const_iterator;
32
34 IteratorRange(const Iterator& begin, const Iterator& end)
35 : _begin(begin)
36 , _end(end)
37 {}
38
41 {}
42
45 {
46 return _begin;
47 }
48
50 iterator end() const
51 {
52 return _end;
53 }
54
55 private:
56
57 Iterator _begin;
58 Iterator _end;
59
60 };
61
62}
63
64#endif // DUNE_COMMON_ITERATORRANGE_HH
Simple range between a begin and an end iterator.
Definition: iteratorrange.hh:20
iterator begin() const
Returns an iterator pointing to the begin of the range.
Definition: iteratorrange.hh:44
Iterator const_iterator
The iterator belonging to this range.
Definition: iteratorrange.hh:31
iterator end() const
Returns an iterator pointing past the end of the range.
Definition: iteratorrange.hh:50
IteratorRange()
Default constructor, relies on iterators being default-constructible.
Definition: iteratorrange.hh:40
Iterator iterator
The iterator belonging to this range.
Definition: iteratorrange.hh:25
IteratorRange(const Iterator &begin, const Iterator &end)
Constructs an iterator range on [begin,end).
Definition: iteratorrange.hh:34
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)