Dune Core Modules (2.4.1)

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
17 template<typename Iterator>
19 {
20
21 public:
22
24 typedef Iterator iterator;
25
27
30 typedef Iterator const_iterator;
31
33 IteratorRange(const Iterator& begin, const Iterator& end)
34 : _begin(begin)
35 , _end(end)
36 {}
37
40 {}
41
44 {
45 return _begin;
46 }
47
49 iterator end() const
50 {
51 return _end;
52 }
53
54 private:
55
56 Iterator _begin;
57 Iterator _end;
58
59 };
60
61}
62
63#endif // DUNE_COMMON_ITERATORRANGE_HH
Simple range between a begin and an end iterator.
Definition: iteratorrange.hh:19
iterator begin() const
Returns an iterator pointing to the begin of the range.
Definition: iteratorrange.hh:43
Iterator const_iterator
The iterator belonging to this range.
Definition: iteratorrange.hh:30
iterator end() const
Returns an iterator pointing past the end of the range.
Definition: iteratorrange.hh:49
IteratorRange()
Default constructor, relies on iterators being default-constructible.
Definition: iteratorrange.hh:39
Iterator iterator
The iterator belonging to this range.
Definition: iteratorrange.hh:24
IteratorRange(const Iterator &begin, const Iterator &end)
Constructs an iterator range on [begin,end).
Definition: iteratorrange.hh:33
Dune namespace.
Definition: alignment.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)