From: Jean-Paul Pelteret Date: Sat, 11 May 2019 16:17:54 +0000 (+0200) Subject: Implement const version of begin() and end() function for IteratorRange X-Git-Tag: v9.1.0-rc1~55^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=806c36950747704168c7d694653593fc02eb1de3;p=dealii.git Implement const version of begin() and end() function for IteratorRange Allows Workstream::run() to be called with constant functions as arguments. --- 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