From 2a95ec1338a4843166fffe7dfdc133bb72e9d21c Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 31 Dec 2024 13:19:30 -0500 Subject: [PATCH] Add an MSVC workaround. The unguarded version works with MSVC 2022 but fails with MSVC 2019. --- include/deal.II/grid/tria_accessor.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 509995fea5..ad2de80d1d 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -3240,7 +3240,12 @@ public: */ boost::container::small_vector< TriaIterator>, - ReferenceCell::max_n_faces()> +#ifndef _MSC_VER // MSVC prior to 2022 cannot use a constexpr function this way + ReferenceCell::max_n_faces() +#else + GeometryInfo::faces_per_cell +#endif + > face_iterators() const; /** @@ -7684,12 +7689,22 @@ CellAccessor::face_iterator_to_index( template inline boost::container::small_vector< TriaIterator>, - ReferenceCell::max_n_faces()> +# ifndef _MSC_VER + ReferenceCell::max_n_faces() +# else + GeometryInfo::faces_per_cell +# endif + > CellAccessor::face_iterators() const { boost::container::small_vector< TriaIterator>, - ReferenceCell::max_n_faces()> +# ifndef _MSC_VER + ReferenceCell::max_n_faces() +# else + GeometryInfo::faces_per_cell +# endif + > face_iterators(this->n_faces()); for (const unsigned int i : this->face_indices()) -- 2.39.5