From: Wolfgang Bangerth Date: Sun, 2 Mar 2025 20:49:05 +0000 (-0700) Subject: Convert a couple places into 'if constexpr'. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab169973f1cfd14b8535cbb35cbc1db95a4f7b61;p=dealii.git Convert a couple places into 'if constexpr'. --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index bb00ca0f46..293c87a2d3 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -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';