|
dune-common 2.12-git
|
Simple range between a begin and an end iterator. More...
#include <dune/common/iteratorrange.hh>
Public Types | |
| typedef Iterator | iterator |
| The iterator belonging to this range. | |
| typedef Sentinel | sentinel |
| The iterator belonging to this range. | |
| typedef Iterator | const_iterator |
| The iterator belonging to this range. | |
Public Member Functions | |
| IteratorRange (const Iterator &begin, const Sentinel &end) | |
| Constructs an iterator range on [begin,end). | |
| IteratorRange () | |
| Default constructor, relies on iterators being default-constructible. | |
| iterator | begin () const |
| Returns an iterator pointing to the begin of the range. | |
| sentinel | end () const |
| Returns an iterator pointing past the end of the range. | |
Detailed Description
class Dune::IteratorRange< Iterator, Sentinel >
Simple range between a begin and an end iterator.
IteratorRange is mainly useful as a lightweight adaptor class when adding support for range-based for loops to existing containers that lack a standard begin(), end() pair of member functions.
This supports to use a different type for the end iterator (a so called sentinel).
- Template Parameters
-
Iterator The type of iterator Sentinel The type of the end iterator (default=Iterator)
Member Typedef Documentation
◆ const_iterator
| typedef Iterator Dune::IteratorRange< Iterator, Sentinel >::const_iterator |
The iterator belonging to this range.
This typedef is here mainly for compatibility reasons.
◆ iterator
| typedef Iterator Dune::IteratorRange< Iterator, Sentinel >::iterator |
The iterator belonging to this range.
◆ sentinel
| typedef Sentinel Dune::IteratorRange< Iterator, Sentinel >::sentinel |
The iterator belonging to this range.
Constructor & Destructor Documentation
◆ IteratorRange() [1/2]
|
inline |
Constructs an iterator range on [begin,end).
◆ IteratorRange() [2/2]
|
inline |
Default constructor, relies on iterators being default-constructible.
Member Function Documentation
◆ begin()
|
inline |
Returns an iterator pointing to the begin of the range.
◆ end()
|
inline |
Returns an iterator pointing past the end of the range.
The documentation for this class was generated from the following file:
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8