]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace use of C-style array by std::array in a second place. 15682/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 8 Jul 2023 06:26:06 +0000 (00:26 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 8 Jul 2023 06:26:06 +0000 (00:26 -0600)
include/deal.II/numerics/vector_tools_constraints.templates.h

index 3fa96e5a782c1be949bb0cd98cb22ddaf2c2b2b7..9f4b162f7cd5627422f358712ae307a4c6f8f974 100644 (file)
@@ -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<unsigned int, size> 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<unsigned int, dim> local_vector_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.