]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Convert a couple places into 'if constexpr'. 18204/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 2 Mar 2025 20:49:05 +0000 (13:49 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 7 Mar 2025 19:01:54 +0000 (12:01 -0700)
source/base/data_out_base.cc

index bb00ca0f468fca791cdaa4d3bb0df0ff8125bb5f..293c87a2d3de6b5598b30bf8a3d06c0db834956c 100644 (file)
@@ -832,7 +832,7 @@ namespace
       // The patch does not store node locations, so we have to interpolate
       // between its vertices:
       {
-        if (dim == 0)
+        if constexpr (dim == 0)
           return patch.vertices[0];
         else
           {
@@ -3349,11 +3349,11 @@ namespace DataOutBase
 
 
     out << "attribute \"element type\" string \"";
-    if (dim == 1)
+    if constexpr (dim == 1)
       out << "lines";
-    if (dim == 2)
+    else if constexpr (dim == 2)
       out << "quads";
-    if (dim == 3)
+    else if constexpr (dim == 3)
       out << "cubes";
     out << "\"" << '\n' << "attribute \"ref\" string \"positions\"" << '\n';
 

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.