]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Inherit iterator traits from the underlying class.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 8 Jun 2023 21:02:44 +0000 (15:02 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 8 Jun 2023 22:10:23 +0000 (16:10 -0600)
include/deal.II/hp/collection.h

index 6e8e89f2da2cf05dec9872a5c4ab742eea09b6a9..acc5860f6ee9ad4bbd246738c803c5eab7cd1c01 100644 (file)
@@ -21,6 +21,7 @@
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/subscriptor.h>
 
+#include <iterator>
 #include <memory>
 #include <vector>
 
@@ -306,11 +307,9 @@ namespace std
    */
   template <class T>
   struct iterator_traits<dealii::hp::CollectionIterator<T>>
-  {
-    using iterator_category = random_access_iterator_tag;
-    using value_type        = T;
-    using difference_type   = std::ptrdiff_t;
-  };
+    : public iterator_traits<
+        typename std::vector<std::shared_ptr<const T>>::iterator>
+  {};
 } // namespace std
 
 #endif

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.