From: Wolfgang Bangerth Date: Sat, 8 Jul 2023 06:26:06 +0000 (-0600) Subject: Replace use of C-style array by std::array in a second place. X-Git-Tag: relicensing~720^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15682%2Fhead;p=dealii.git Replace use of C-style array by std::array in a second place. --- diff --git a/include/deal.II/numerics/vector_tools_constraints.templates.h b/include/deal.II/numerics/vector_tools_constraints.templates.h index 3fa96e5a78..9f4b162f7c 100644 --- a/include/deal.II/numerics/vector_tools_constraints.templates.h +++ b/include/deal.II/numerics/vector_tools_constraints.templates.h @@ -86,33 +86,24 @@ namespace VectorTools { static const unsigned int size = 3; // store active fe indeX, face number, DoF index - unsigned int indices[size]; + std::array indices; bool operator<(const FaceDoFInfo &other) const { - for (unsigned int i = 0; i < size; ++i) - if (indices[i] < other.indices[i]) - return true; - else if (indices[i] > other.indices[i]) - return false; - return false; + return (indices < other.indices); } bool operator==(const FaceDoFInfo &other) const { - for (unsigned int i = 0; i < size; ++i) - if (indices[i] != other.indices[i]) - return false; - - return true; + return (indices == other.indices); } bool operator!=(const FaceDoFInfo &other) const { - return !(*this == other); + return (indices != other.indices); } }; @@ -548,7 +539,7 @@ namespace VectorTools { local_vector_indices[0] = i; const FaceDoFInfo local_face_dof_info = { - {cell->active_fe_index(), face_no, i}}; + {{cell->active_fe_index(), face_no, i}}}; for (unsigned int k = 0; k < fe.n_dofs_per_face(face_no); ++k) if ((k != i) && @@ -648,7 +639,7 @@ namespace VectorTools !refinement_edge_indices.is_element(face_dofs[i])) { const FaceDoFInfo face_dof_info = { - {cell->active_fe_index(), face_no, i}}; + {{cell->active_fe_index(), face_no, i}}}; const auto it = dof_to_vector_dof.find(face_dof_info); Assert(it != dof_to_vector_dof.end(), ExcInternalError()); const std::array local_vector_indices =