From 806c36950747704168c7d694653593fc02eb1de3 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 11 May 2019 18:17:54 +0200 Subject: [PATCH] Implement const version of begin() and end() function for IteratorRange Allows Workstream::run() to be called with constant functions as arguments. --- include/deal.II/base/iterator_range.h | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/deal.II/base/iterator_range.h b/include/deal.II/base/iterator_range.h index dd3f0d20d5..41c5f40a6f 100644 --- a/include/deal.II/base/iterator_range.h +++ b/include/deal.II/base/iterator_range.h @@ -161,6 +161,19 @@ public: IteratorOverIterators begin(); + /** + * Return the iterator pointing to the first element of this range. + */ + IteratorOverIterators + begin() const; + + /** + * Return the iterator pointing to the element past the last element of this + * range. + */ + IteratorOverIterators + end() const; + /** * Return the iterator pointing to the element past the last element of this * range. @@ -379,6 +392,14 @@ IteratorRange::begin() } +template +inline typename IteratorRange::IteratorOverIterators +IteratorRange::begin() const +{ + return it_begin; +} + + template inline typename IteratorRange::IteratorOverIterators IteratorRange::end() @@ -387,6 +408,14 @@ IteratorRange::end() } +template +inline typename IteratorRange::IteratorOverIterators +IteratorRange::end() const +{ + return it_end; +} + + DEAL_II_NAMESPACE_CLOSE #endif -- 2.39.5