]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an MSVC workaround. 17965/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 31 Dec 2024 18:19:30 +0000 (13:19 -0500)
committerDavid Wells <drwells@email.unc.edu>
Wed, 1 Jan 2025 15:54:48 +0000 (10:54 -0500)
The unguarded version works with MSVC 2022 but fails with MSVC 2019.

include/deal.II/grid/tria_accessor.h

index 509995fea5ee8bda2327c82dd479b12e7399a3b7..ad2de80d1de8a07b0aa503b2a92726d70571a7b6 100644 (file)
@@ -3240,7 +3240,12 @@ public:
    */
   boost::container::small_vector<
     TriaIterator<TriaAccessor<dim - 1, dim, spacedim>>,
-    ReferenceCell::max_n_faces<dim>()>
+#ifndef _MSC_VER // MSVC prior to 2022 cannot use a constexpr function this way
+    ReferenceCell::max_n_faces<dim>()
+#else
+    GeometryInfo<dim>::faces_per_cell
+#endif
+    >
   face_iterators() const;
 
   /**
@@ -7684,12 +7689,22 @@ CellAccessor<dim, spacedim>::face_iterator_to_index(
 template <int dim, int spacedim>
 inline boost::container::small_vector<
   TriaIterator<TriaAccessor<dim - 1, dim, spacedim>>,
-  ReferenceCell::max_n_faces<dim>()>
+#  ifndef _MSC_VER
+  ReferenceCell::max_n_faces<dim>()
+#  else
+  GeometryInfo<dim>::faces_per_cell
+#  endif
+  >
 CellAccessor<dim, spacedim>::face_iterators() const
 {
   boost::container::small_vector<
     TriaIterator<TriaAccessor<dim - 1, dim, spacedim>>,
-    ReferenceCell::max_n_faces<dim>()>
+#  ifndef _MSC_VER
+    ReferenceCell::max_n_faces<dim>()
+#  else
+    GeometryInfo<dim>::faces_per_cell
+#  endif
+    >
     face_iterators(this->n_faces());
 
   for (const unsigned int i : this->face_indices())

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.