]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a convenience function to make IteratorRange objects
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 2 May 2019 17:31:34 +0000 (19:31 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 2 May 2019 17:31:34 +0000 (19:31 +0200)
include/deal.II/base/iterator_range.h

index d2b054cb78cec2189693b1671e154ef6e9d81ff5..a90266a88cd14cd48b5a1745906304856b7c0644 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <deal.II/base/config.h>
 
+#include <deal.II/base/template_constraints.h>
+
 #include <iterator>
 
 
@@ -251,6 +253,23 @@ private:
 };
 
 
+
+/**
+ * Create an object of type IteratorRange given the beginning and
+ * end iterator.
+ *
+ * @author Jean-Paul Pelteret, 2019
+ */
+template <typename BaseIterator>
+IteratorRange<BaseIterator>
+make_iterator_range(const BaseIterator &                         begin,
+                    const typename identity<BaseIterator>::type &end)
+{
+  IteratorRange<BaseIterator> ir(begin, end);
+  return ir;
+}
+
+
 // ------------------- template member functions
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.