]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Enable make_array_view() also for C++20-style contiguous iterators.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 8 Jun 2023 21:04:18 +0000 (15:04 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 8 Jun 2023 22:10:23 +0000 (16:10 -0600)
include/deal.II/base/array_view.h

index 67e69e6c2d0e4aa2ebe7fceb760bb6f2ea76410b..568ee71b12bdd596719793e7e90d8891355578b3 100644 (file)
@@ -705,7 +705,13 @@ make_array_view(const Iterator begin, const Iterator end)
 {
   static_assert(
     std::is_same<typename std::iterator_traits<Iterator>::iterator_category,
-                 typename std::random_access_iterator_tag>::value,
+                 typename std::random_access_iterator_tag>::value
+#ifdef DEAL_II_HAVE_CXX20
+      ||
+      std::is_same<typename std::iterator_traits<Iterator>::iterator_category,
+                   typename std::contiguous_iterator_tag>::value
+#endif
+    ,
     "The provided iterator needs to be a random access iterator.");
   Assert(begin <= end,
          ExcMessage(

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.